First you have to install R (i use v. 3.3.3)
Install twitteR, streamR, ROAuth packages
----------------------------
after that, u have to call the library packages
----------------------------
> library (twitteR)
> library (ROAuth)
> library (streamR)
----------------------------
connect to twitter stream API
----------------------------
> requestURL <- api.twitter.com="" br="" https:="" oauth="" request_token="">> accessURL <- access_token="" api.twitter.com="" br="" https:="" oauth="">> authURL <- api.twitter.com="" authorize="" https:="" oauth="" p="">
----------------------------
enter you twitter key that registered in
https://apps.twitter.com/
----------------------------
> consumerKey <- br="" consumerkey="" your="">> consumerSecret <- br="" consumersecret="" your="">->->
----------------------------
paste this code
----------------------------
twitCred <- consumerkey="consumerKey,<br" new="" oauthfactory=""> consumerSecret=consumerSecret,
requestURL=reqURL,
accessURL=accessURL,
authURL=authURL)->
options(RCurlOptions = list(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl")))
my_oauth <- consumerkey="consumerKey,<br" new="" oauthfactory=""> consumerSecret=consumerSecret, requestURL=requestURL,
accessURL=accessURL, authURL=authURL)->
my_oauth$handshake(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))
-------------------------------
this is the happiest part,
if you didn't get any error massage, paste this code below your R workshop
-------------------------------
filterStream( file.name="XYZ.json",
+ track="ABC", tweets=10, oauth=my_oauth )
XYZ will be the name for your export file (default folder is in My Documents)
change ABC to your word that you wanna stream in Twitter.
tweets=10 is number of tweets that will be streamed.
Here's my result sample
Feel free to ask me by fill comment section below or ask me directly via facebook.com/rakhmatalfian
Have some fun ^_^->->->