Skip to content
This repository has been archived by the owner on Apr 11, 2019. It is now read-only.

Oauth httr v1.0 #92

Merged
merged 2 commits into from
Jul 12, 2015
Merged

Oauth httr v1.0 #92

merged 2 commits into from
Jul 12, 2015

Conversation

jrowen
Copy link
Contributor

@jrowen jrowen commented Jul 10, 2015

I believe this fixes #90 by reimplementing the http v0.6 logic in this package.

@geoffjentry
Copy link
Owner

@jrowen Thanks for submitting this! It's not working for me though, should this be a drop in replacement?

@geoffjentry
Copy link
Owner

@jrowen Disregard - after trying to figure it out myself I got it working and then looked back here and realized our solutions were nearly identical. I tried reloading your version and it works fine. Presumably operator error on my part. Thanks again!

geoffjentry added a commit that referenced this pull request Jul 12, 2015
@geoffjentry geoffjentry merged commit aa555cf into geoffjentry:master Jul 12, 2015
@jrowen
Copy link
Contributor Author

jrowen commented Jul 12, 2015

Glad it worked out.

On Sun, Jul 12, 2015, 2:52 PM Jeff Gentry notifications@github.com wrote:

Merged #92 #92.


Reply to this email directly or view it on GitHub
#92 (comment).

@ghost
Copy link

ghost commented Jul 13, 2015

With @geoffjentry's merge into master, I was under the impression that I could just reinstall twitteR via devtools::install_github but that doesn't seem to have worked. I also upgraded httr to version 1.0.0.9000 and restarted RStudio, but it is issuing the same error as before. Should I be installing @jrowen's branch as well?

@jrowen
Copy link
Contributor Author

jrowen commented Jul 13, 2015

This is working for me with httr v1.0 and the latest version of twitteR on
github. You should no longer need to install my fork. When prompted for
direct authentication choose No.

On Mon, Jul 13, 2015, 7:01 AM Bryan Britten notifications@github.com
wrote:

With @geoffjentry https://github.com/geoffjentry's merge into master, I
was under the impression that I could just reinstall twitteR via
devtools::install_github but that doesn't seem to have worked. I also
upgraded httr to version 1.0.0.9000 and restarted RStudio, but it is no
issuing the same error as before. Should I be installing @jrowen
https://github.com/jrowen's branch as well?


Reply to this email directly or view it on GitHub
#92 (comment).

@geoffjentry
Copy link
Owner

@theRanalyst It's interesting that you say that because I had the exact same problem at first when I was testing @jrowen PR. Then I went and fiddled with it for a bit and a while later tried it again (without reason to believe anything was different) and it worked.

It could be that the local caching that httr does is invalid, I believe when I ran it the second time I was in a different directory.

@ghost
Copy link

ghost commented Jul 13, 2015

Here is what I get in a brand new R session:

> library(httr)
> library(twitteR)
> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.3 (Yosemite)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] twitteR_1.1.8   httr_1.0.0.9000

loaded via a namespace (and not attached):
[1] bit_1.1-12         rjson_0.2.15       R6_2.1.0          
[4] magrittr_1.5       DBI_0.3.1          tools_3.2.0       
[7] bit64_0.9-5        stringi_0.5-5      stringr_1.0.0.9000
> source("~/Dropbox/R/twitterKeys.R")
> setup_twitter_oauth(consumerKey, consumerSecret, oauthKey, oauthSecret)
[1] "Using direct authentication"
Use a local file to cache OAuth access credentials between R sessions?
1: Yes
2: No

Selection: 2
Error in check_twitter_oauth() : OAuth authentication error:
This most likely means that you have incorrectly called setup_twitter_oauth()'
>

@ghost
Copy link

ghost commented Jul 13, 2015

@geoffjentry One thing I've noticed is that if I choose Yes when prompted to use a local file to cache OAuth, it doesn't create a .httr-oauth file as I would expect. It gets added to my .gitignore file, but there is no actual .httr-oauth file to access. It's possible this is causing me an issue as well.

@geoffjentry
Copy link
Owner

@theRanalyst One thing to try would be to do Hadley's demo by hand and then in a new R session try the new twitteR, as that's effectively what I did. As I said I also was in a different directory (I wasn't using RStudio) when it did work although not intentionally.

Those are the only two things I can think of that happened between the first time I ran it and when it worked.

You might try doing a find on .httr-oauth, perhaps it's getting created somewhere you don't expect? Not sure how that would work with RStudio.

@jrowen
Copy link
Contributor Author

jrowen commented Jul 13, 2015

You can also try using debug(twitteR:::get_twitter_token_via_sign) to see if you can track down where the error occurs.

Another option could be to remove all packages using remove.packages (or the x in the RStudio package pane) and then re-install.

@ghost
Copy link

ghost commented Jul 13, 2015

@jrowen @geoffjentry Thanks for the advice. I've gone through what you've suggested and here's what I found. Using the debug function didn't help because it made it all the way through the function but then exited with the same error we were all getting before. However, working through Hadley's demo did help. The issue ended up being a package that wasn't installed.

You have to have the base64enc package installed in order for this to work properly.

Aside from that, everything appears to be work as one would hope. Nice work, guys!

@sfirke
Copy link

sfirke commented Jul 28, 2015

@theRanalyst good call on having the base64enc package loaded - that fixed things for me, thanks!

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

Successfully merging this pull request may close these issues.

Error in check_twitter_oauth( )
4 participants