r - Retrieving cached oauth token with packages httr, twitteR, and streamR -
the way i've found myself authenticated twitter api following:
library(twitter) setup_twitter_oauth(consumer_key = "a", consumer_secret = "b", access_token = "c", access_secret = "d")
after running this, can use functions in twitter fine. however, use streamr package, needs token oauth object:
filterstream("tweets.json", track = c("obama", "biden"), timeout = 20, oauth=my_oauth)
from gather, setup_twitter_oauth function above wrapper around httr functions authorization token. token cached in working directory file called ".httr-oauth". question is: how load file r, such oauth object can use streamr?
use readrds()
readrds('.httr-oauth') $xxxx0x000xxxx00000x0xx0x000000xx request: https://api.twitter.com/oauth/request_token authorize: https://api.twitter.com/oauth/authenticate access: https://api.twitter.com/oauth/access_token twitter key: xxxxxxxxxx0xxxxxxxxxxxxxx secret: oauth_token, oauth_token_secret, user_id, screen_name
access environment in list through $long-alphanumeric-hash
, within access $credentials
, $oauth_token
/$oauth_token_secret
Comments
Post a Comment