Twitter API - Please migrate to API v1.1 [duplicat

2019-03-22 07:24发布

This question already has an answer here:

Actually, i am using this like

https://api.twitter.com/1/statuses/user_timeline.rss?screen_name='screen_name'

for fetching the feeds related to that particular screen name. But, due to the change of API version 1 to 1.1 , it's not working properly and i am not fetching any records and i will return this type of xml

<errors>
<error code="68">
The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.
</error>
</errors>

So, please suggest me, how i fetch the data of any particular scree name...

标签: php twitter
3条回答
太酷不给撩
2楼-- · 2019-03-22 07:50

Open the File twitteroauth.php and Just Change the old URL : api.twitter.com/1/ with URL : api.twitter.com/1.1/ .

Its Worked . If its not working Properly check out your configuration for Consumer Secret key or Twitter API Key .

Thanks

查看更多
一夜七次
3楼-- · 2019-03-22 08:02

Yes, you've noticed that the REST API v1 is no longer active. It was removed completely as of 11th June 2013.

Deprecation and removal proof

See the /1/ in your url? That's a call to the v1 API, which you can't do anymore. You need to make requests to /1.1/, but it's not as simple as just changing the url. You need to make authenticated requests using OAuth.

user_timeline

The docs for user_timeline show what type of call it is (in this case, it's a GET request), and it also provides the resource url:

https://api.twitter.com/1.1/statuses/user_timeline.json

This knowledge is not enough though. You need to make authenticated requests with the above knowledge.

Authenticated Requests

You need to make authenticated requests now, which involves a lot of complex stuff like creating the correct request headers and authorizing your application using a set of keys. Fortunately, here's a post which explains exactly how to do this, and a file to include that allows you to make the requests simply and easily.

What stuff do you need?

You'll need the above resource URL, the type of request ('GET'), and a dev application on the twitter site. Again, the previous link explains why you need these, but it's pretty simple if you follow it step by step.

Read the docs below and get an understanding of what you can do.

Useful Links

Twitter Dev Site
Developer Docs

查看更多
女痞
4楼-- · 2019-03-22 08:04

change in oauth.php $host = "https://api.twitter.com/1/"; to $host = "https://api.twitter.com/1.1/";

查看更多
登录 后发表回答