Comments (4)
I gave a go at this one.
I haven't tested it within the ramazon function but it provides the correct link! Note that this pulls the most recent build which is not the same one advertised on the shiny server website which is a couple versions back. The latest release might be have some bugs?
Lines 69 to 87:
https://github.com/ScientistJake/ramazon/blob/master/R/ramazon_mac.R
#XML is needed for this next chunk:
#Here we parse the xml of download3.rstudio.org/
#Using the rootsize we can extract the last entry which is the latest version of shiny server
if(!require(XML)){
install.packages("XML")
library(XML)
}
xml.url <- 'http://download3.rstudio.org/'
xmlParsed <- xmlParse(xml.url)
rootnode <- xmlRoot(xmlParsed)
rootsize <- xmlSize(rootnode)
latest_shiny_path <- xmlValue(rootnode[[rootsize]][[1]])
shiny_version <- unlist(strsplit(latest_shiny_path,'/'))[3]
# install latest Shiny server version
command <- c("\necho 'R installed'")
command <- append(command,"sudo apt-get install -y gdebi-core")
command <- append(command,paste0("wget https://download3.rstudio.org/",latest_shiny_path))
command <- append(command,paste0("sudo gdebi --non-interactive ",shiny_version))
from ramazon.
nice and smooth, we'd better handle xml dependence within the package description, avoiding to employ require : http://r-pkgs.had.co.nz/description.html#dependencies
what do you think @ScientistJake ?
from ramazon.
@AndreaCirilloAC That looks like the way to do it! I added:
Imports:
XML
To the DESCRIPTION file and changed the html parsing to call XML:
xml.url <- 'http://download3.rstudio.org/'
xmlParsed <- XML::xmlParse(xml.url)
rootnode <- XML::xmlRoot(xmlParsed)
rootsize <- XML::xmlSize(rootnode)
latest_shiny_path <- XML::xmlValue(rootnode[[rootsize]][[1]])
shiny_version <- unlist(strsplit(latest_shiny_path,'/'))[3]
I tested the install, and it loads XML. I also tested the XML function above. If you it looks good it's ready to push https://github.com/ScientistJake/ramazon
from ramazon.
closed with #10, thank you @ScientistJake !
from ramazon.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ramazon.