Python 中的 Twitter 搜索查询 [英] Twitter Search Query in Python
本文介绍了Python 中的 Twitter 搜索查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试提取与给定搜索查询匹配的推文.我正在使用以下代码:
I am trying to pull tweets matching the given search query. I'm using the following code :
import urllib2 as urllib
import json
response = urllib.urlopen("https://search.twitter.com/search.json?q=microsoft")
pyresponse = json.load(response)
print pyresponse
这几天前还可以,但现在突然停止了.在谷歌的帮助下,我了解到不再支持这种类型的 url.
This was working a few days ago, but suddenly stopped working now. With some help from google, I learned that this type of url in not supported anymore.
我如何执行此搜索查询.我应该使用什么网址?
How do I perform this search query. What url shall I use?
推荐答案
Twitter 正在弃用未经身份验证的搜索.您应该查看 Tweepy 或其他与 Twitter 交互的 Python 库.https://github.com/tweepy/tweepy
Twitter is deprecating non-authenticated searches. You should look into Tweepy or another Python library that interacts with Twitter. https://github.com/tweepy/tweepy
这篇关于Python 中的 Twitter 搜索查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文