POST update to Twitter using Oauth and HTTR, R -
i trying post update twitter using api. following steps @ https://github.com/hadley/httr/blob/master/demo/oauth1-twitter.r, can get call work, haven't managed post work. here relevant code:
library(httr) library(httpuv) oauth_endpoints("twitter") myapp <- oauth_app("twitter", key = "key" secret = "secret" ) twitter_token <- oauth1.0_token(oauth_endpoints("twitter"), myapp) #this works fine req <- get("https://api.twitter.com/1.1/statuses/home_timeline.json", config(token = twitter_token)) #this doesn't work. returns error 403: status forbidden post(url = "https://api.twitter.com/1.1/statuses/update.json", body = "test", config(token = twitter_token) )
any solution allows status update (tweet) r acceptable.
the docs need pass parameter status
query parameter, not in body, makes sense b/c can 140 characters long anyway.
post("https://api.twitter.com/1.1/statuses/update.json", query = list(status = "testing r"), config(token = twitter_token) )
Comments
Post a Comment