[R-pkg-devel] Help with making a package for Twitter Authentication

Peter Meissner retep.meissner at gmail.com
Sun Nov 22 04:07:00 CET 2015


I am not sure, that this is the right list for questions that are 'only 
mildly' related to package developement. Your question is more about 
API/webscraping etc. . 

Maybe someone can point to a better place to post questions like this?. 

... that beeing said ... 

If I understand your problem right, I would suggest to try out the 
twitteR package [1] which already has authentication and data retrieval 
build in. 

If you do want to do it on your own I would suggest building on top of 
httr [2] for  authentication and HTTP-communication to access 
information from the official Twitter API [3]. Make sure to have a look 
at the demo provided on httr's Github repo [4]. Also the httr vignette 
on how to write API wrapper packages might be useful and last and very 
least I build a kind of minimal package for reading tweets and tweeting 
ot be found on my Github [5] which might also be of use because it only 
implements reading tweets of specific user.

Good luck, Peter

[1] https://cran.r-project.org/web/packages/twitteR/index.html
[2] https://cran.r-project.org/web/packages/httr/index.html
[3] https://dev.twitter.com/rest/public
[4] https://github.com/hadley/httr/blob/master/demo/oauth1-twitter.r
[5] https://github.com/petermeissner/twitterlight

Am Do, 19. Nov, 2015 um 5:33 schrieb Tushar Sadhu 
<tushar.sadhu08 at gmail.com>:
> Hello and greetings
> I have been doing Twitter Data Analysis following a few blogs which
> requires me to register as a developer and enter a PIN everytime I 
> want to
> start reading tweets. But now I have made a basic package which does 
> all
> the hectic authentication, but the PIN from an authorized app is still
> required.
> (specifically after twitCred is correctly defined and this step :
> twitCred$handshake(cainfo = system.file("CurlSSL", "cacert.pem", 
> package =
> "RCurl"))     )
> Though it works and reduces the steps, it still has to go to the URL 
> and
> enter the PIN manually
> So my questions are two :
> 1. If I go ahead with the current method of reading tweets by logging 
> from
> my account, how do I automate the process of entering the PIN when 
> the code
> runs inside the package?
> 2. What is the standard method of gathering tweets without any
> authentication at all. How is it done professionally without using 
> anyone's
> account and PIN.
> This is my first question here and I am not sure if I am following the
> right protocols or am asking silly questions. In either case I am 
> sorry.
> Please help!
> Also Thankyou in advance :)
> Regards
> Tushar Sadhu
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

	[[alternative HTML version deleted]]

More information about the R-package-devel mailing list