あなたはpacakgeでそれを行うことができますROAuth
。アプリをTwitterに登録し、APIキーを持っていると仮定します。Stack Overflowの他の質問(その質問と関連する回答には他の貢献する質問へのリンクも含まれています)とパッケージROAuth
およびのドキュメントからこれをまとめましたtwitteR
。
library(RCurl)
library(twitteR)
library(ROAuth)
requestURL <- "https://api.twitter.com/oauth/request_token"
accessURL = "http://api.twitter.com/oauth/access_token"
authURL = "http://api.twitter.com/oauth/authorize"
consumerKey = "myconsumerkeystring"
consumerSecret = "myconsumersecretstring"
Cred <- OAuthFactory$new(consumerKey=consumerKey,
consumerSecret=consumerSecret,
requestURL=requestURL,
accessURL=accessURL,
authURL=authURL)
#The next command provides a URL which you will need to copy and paste into your favourite browser
#Assuming you are logged into Twitter you will then be provided a PIN number to type into the R command line
Cred$handshake(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl") )
# Checks that you are authorised
registerTwitterOAuth(Cred)
ストリーミングAPIの使用はパッケージによって処理されると思いますstreamR
HTH