Search twitter feeds with Tweepy

霸气de小男生 提交于 2019-12-08 06:20:28

问题


Thanks to @Nirvana Tikku, he solved my question on how to talk with Tweepy and perform simple search in this Question. The below are a series of code summary on how i authenticate my tweepy on GAE.

import tweepy

creds = json.loads(open('credential.json').read())
tw_consumer_key = creds['tw_consumer_key']
tw_consumer_secret = creds['tw_consumer_secret']
tw_access_token = creds['tw_access_token']
tw_access_token_secret = creds['tw_access_token_secret']

try:
    auth = tweepy.OAuthHandler(tw_consumer_key, tw_consumer_secret)
    auth.set_access_token(tw_access_token, tw_access_token_secret)
    api = tweepy.API(auth)
except Exception:
    print "Tweepy Error"
    service = None
    api = None 

I have a question after success authenticate the tweepy and could have a talk with it. I need to implement the streaming API to get LIVE feeds from twitter. Is anyone here could give me a guide on how to implement the "firehose"? some sample code, please. Thanks


回答1:


Here's an answer from a similar question in the Tweepy forum: https://groups.google.com/forum/#!topic/tweepy/BLSRYzG1Tps

Quoting steveobd there: "GAE doesn't support listen sockets only outbound sockets (https://developers.google.com/appengine/docs/python/sockets/). You'll have to use Google Compute Engine or Heroku or similar."



来源:https://stackoverflow.com/questions/14494687/search-twitter-feeds-with-tweepy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!