如何使用 Twitter 搜索 api 获取结果? [英] How to get results with twitter search api?
问题描述
我希望获得带有关键字的推文.但是任何关键字都没有结果.
I wish to get tweets with a keyword. But There is no result with any keyword.
http://search.twitter.com/search.json?q=summer
如何使用 Twitter Search API 获取结果?
How to get results with Twitter Search API?
推荐答案
Twitter API 的第 1 版已被弃用,并且正在被删除.不知道你怎么会错过 Twitter 开发站点上的巨大警告;) 这意味着像上面这样的简单代码将不再起作用.
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.
因此,您现在需要使用 1.1 API 发出经过身份验证的请求 (OAuth),这远不及执行(在 PHP 中)file_get_contents(http://search.twitter.com/) 那么简单...)
.
So, 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/ ...)
.
我无法从您的个人资料中看到您使用的任何服务器端语言,但我写了一个 解释问题的冗长帖子(带图片)以及如何使用php 库以执行经过身份验证的请求.
I couldn't see any server-side languages you use from your profile, but I wrote a lengthy post explaining the issue (with pictures) and how to use a php library to perform authenticated requests.
这篇关于如何使用 Twitter 搜索 api 获取结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!