简体   繁体   English

(最新)适用于Twitter API的Python包装器

[英](recent) Python Wrapper for Twitter API

I'm looking for a python wrapper for current Twitter API just to perform simple searches, but the wrappers I've tried (twython, python-twitter, etc.) are all outdated, and cannot perform search with under current Twitter. 我正在为当前的Twitter API寻找python包装器,只是为了执行简单的搜索,但是我尝试过的包装器(twython,python-twitter等)都已过时,并且无法在当前的Twitter下执行搜索。

Is there a python wrapper that is updated to work with current twitter? 是否有经过更新的Python包装器可与当前Twitter一起使用?

If you need only searches — take one of the python's OAuth libs ( this one for example), and make calls yourself. 如果您只需要搜索,请使用python的OAuth库之一 (例如库),然后自己进行调用。 For small subset of requests it would be faster solution then searching and evaluating different libraries. 对于小的请求子集,这将是更快的解决方案,然后搜索和评估不同的库。

I used http://pypi.python.org/pypi/python-twitter/ about a year or two ago and it's still in the same version 0.8.2. 一两年前,我使用了http://pypi.python.org/pypi/python-twitter/ ,它的版本仍然是0.8.2。 It served well for all I needed at that point - just posting tweets. 那时,它可以满足我的所有需求-仅发布推文。 If you're about to do something simple, it may suffice. 如果您要做一些简单的事情,那就足够了。

I figured, to perform a simple search, it's better not to go through all the wrappers... You can simply use http GET search as follows: 我认为,要执行简单的搜索,最好不要遍历所有包装器……您可以按如下所示使用http GET搜索:

import urllib2
parent = urllib2.urlopen("https://api.twitter.com/1/statuses/show.json?id=291095878196920320&include_entities=true").read()

you can of course write it to file, etc. 您当然可以将其写入文件等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM