Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix baseURL for phantomjs #22

Merged
merged 3 commits into from
May 6, 2016
Merged

fix baseURL for phantomjs #22

merged 3 commits into from
May 6, 2016

Conversation

yasirs
Copy link
Contributor

@yasirs yasirs commented May 6, 2016

No description provided.

#' other sites functional at that time.
#' @return \code{NULL} (the executable is written to a system directory).
#' @export
install_phantomjs <- function(version = '2.1.1',
baseURL = 'https://bitbucket.org/ariya/phantomjs/downloads/') {
if (substr(baseURL, start=nchar(baseURL), stop=nchar(baseURL))!='/') baseURL <- paste0(baseURL,"/",sep="")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be a bit cleaner to do:

if (!grepl("/$", baseURL))
  baseURL <- paste0(baseURL, "/")

@wch
Copy link
Owner

wch commented May 6, 2016

If you're using RStudio, you can automatically wrap the comment text at 80 characters by pressing Ctrl-Shift-/ (or Cmd-Shift-/ on Mac), which would keep it consistent with the other text.

@wch wch merged commit 8d0d7d9 into wch:master May 6, 2016
@wch
Copy link
Owner

wch commented May 6, 2016

Thanks!

@wch
Copy link
Owner

wch commented May 6, 2016

The alternate URL still doesn't work:

> install_phantomjs(baseURL="https://github.com/paladox/phantomjs/releases/download/2.1.7/")
downloaded 0 bytes

Error in utils::download.file(paste0(baseURL, zipfile), zipfile, mode = "wb") : 
  cannot download all files
In addition: Warning message:
In utils::download.file(paste0(baseURL, zipfile), zipfile, mode = "wb") :
  URL 'https://github-cloud.s3.amazonaws.com/releases/54499329/4b442e54-f110-11e5-9cbe-07dc869e00fc.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160506%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160506T194029Z&X-Amz-Expires=300&X-Amz-Signature=cf8470cb46020dd469b4b2b2f976ce01e767caeb2e7e29ad71ad7233cf96b376&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dphantomjs-2.1.1-macosx.zip&response-content-type=application%2Foctet-stream': status was '403 Forbidden'

@yasirs
Copy link
Contributor Author

yasirs commented May 6, 2016

Weird. Works for me:

library(webshot)
install_phantomjs(baseURL="
https://github.com/paladox/phantomjs/releases/download/2.1.7/")
trying URL '
https://github.com/paladox/phantomjs/releases/download/2.1.7/phantomjs-2.1.1-macosx.zip
'

Content type 'application/octet-stream' length 17148816 bytes (16.4 MB)

downloaded 16.4 MB

phantomjs.exe has been installed to /Users/yasir/Library/Application
Support/PhantomJS

On Fri, May 6, 2016 at 3:45 PM, Winston Chang [email protected]
wrote:

The alternate URL still doesn't work:

install_phantomjs(baseURL="https://github.com/paladox/phantomjs/releases/download/2.1.7/")
downloaded 0 bytes

Error in utils::download.file(paste0(baseURL, zipfile), zipfile, mode = "wb") :
cannot download all files
In addition: Warning message:
In utils::download.file(paste0(baseURL, zipfile), zipfile, mode = "wb") :
URL 'https://github-cloud.s3.amazonaws.com/releases/54499329/4b442e54-f110-11e5-9cbe-07dc869e00fc.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160506%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160506T194029Z&X-Amz-Expires=300&X-Amz-Signature=cf8470cb46020dd469b4b2b2f976ce01e767caeb2e7e29ad71ad7233cf96b376&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dphantomjs-2.1.1-macosx.zip&response-content-type=application%2Foctet-stream': status was '403 Forbidden'


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#22 (comment)

@petermeissner
Copy link

it refuses to work for me (CRAN version and Github version)

webshot::install_phantomjs()
downloaded 0 bytes

Fehler in utils::download.file(paste0(baseURL, zipfile), zipfile, mode = "wb") : 
  cannot download all files
Zusätzlich: Warnmeldung:
In utils::download.file(paste0(baseURL, zipfile), zipfile, mode = "wb") :
  URL 'https://bbuseruploads.s3.amazonaws.com/fd96ed93-2b32-46a7-9d2b-ecbc0988516a/downloads/396e7977-71fd-4592-8723-495ca4cfa7cc/phantomjs-2.1.1-linux-x86_64.tar.bz2?Signature=9n1SBCDUqBGVCY4QigWcLsIDhtE%3D&Expires=1465815357&AWSAccessKeyId=AKIAIWY5XSVPZPDQYRQQ&versionId=null&response-content-disposition=attachment%3B%20filename%3D%22phantomjs-2.1.1-linux-x86_64.tar.bz2%22': status was '403 Forbidden'

on a Win10 hosted VM:

sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.4 LTS

locale:
 [1] LC_CTYPE=de_DE.UTF-8       LC_NUMERIC=C               LC_TIME=de_DE.UTF-8        LC_COLLATE=de_DE.UTF-8    
 [5] LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=de_DE.UTF-8        LC_PAPER=de_DE.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=de_DE.UTF-8     LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] httr_1.1.0         magrittr_1.5       R6_2.1.2           htmltools_0.3.5    tools_3.3.0        withr_1.0.1       
 [7] curl_0.9.6         yaml_2.1.13        memoise_1.0.0      Rcpp_0.12.5        rmarkdown_0.9.6        knitr_1.13        
[13] git2r_0.15.0       webshot_0.3.0.9000 digest_0.6.9       devtools_1.11.1   

@wch
Copy link
Owner

wch commented Jun 13, 2016

@petermeissner Can you file a new issue for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants