Twitter Search API Php

2020-02-07 11:09发布

I am facing a problem in twitter api.

https://search.twitter.com/search.json?q=test&rpp=5&include_entities=1

I have used the above URL for getting the tweets for the given query. It worked well until yesterday. But now I have checked, this is returning empty result set.

I have surfed through the twitter api and I can't able to find the relevant api method. Please help me to achieve this. Thanks in advance.

标签: twitter
2条回答
一夜七次
2楼-- · 2020-02-07 11:34

You use a deprecated API (1.0), Twitter is shutting down this one and moving to 1.1. see here:Twitter API 1.1

查看更多
forever°为你锁心
3楼-- · 2020-02-07 11:35

Your Issue

There's a bug reported here that corresponds with the issue you're having.

5 days

You literally have five days until unauthenticated requests will not function at all any more.

enter image description here

You now need to make authenticated requests (OAuth) using the 1.1 API, and it's nowhere near as simple as just doing a (in PHP) file_get_contents(http://search.twitter.com/ ...).

Version 1 of the twitter API has been deprecated and is being removed. Not sure how you can miss the giant warnings on the twitter dev site ;) This means simple code like the above will not work any more.

Check out this post on how to make authenticated requests using PHP.

查看更多
登录 后发表回答