문제

I'm trying to follow the demo in the httr package to authorize myself with twitter. However, using the code in the demo only produces this error:

Response [https://api.twitter.com/1/statuses/home_timeline.json]
  Status: 410
  Content-type: application/json; charset=utf-8
{"errors": [{"message": "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68}]} 

What in the code would need to be changed to allow it to work with Twitter API v1.1 (note that the key and token below are from the demo, but I use my own to produce the error above)?

I've also tried using the Roauth package, but it gives me the same error as here: strsplit error when attempting to access Fitbit with ROAuth

myapp <- oauth_app("twitter", key = "TYrWFPkFAkn4G5BbkWINYw")

sig <- sign_oauth1.0(myapp,
  token = "69133574-FZ9GJlJ57V0SVdNAzo71mQZSUrpUbiJZBVpDmbYkd",
  token_secret = Sys.getenv("TWITTER_ACCESS_SECRET"))

GET("https://api.twitter.com/1/statuses/home_timeline.json", sig)
도움이 되었습니까?

해결책

Try ... GET("https://api.twitter.com/1.1/statuses/home_timeline.json", sig) instead (substitute 1 by 1.1).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top