tweepy

Search twitter feeds with Tweepy

谁都会走 提交于 2019-12-08 21:45:32
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

Tweepy error code 400

一世执手 提交于 2019-12-08 18:52:22
问题 I am trying to download some tweets for research purpose the code worked very well until a few days ago. Error Message > Traceback (most recent call last): > > File "<ipython-input-1-10547a7aea4c>", line 1, in <module> > runfile('F:/twitter_locations_n_scraper/02_twitterscrapping.py', wdir='F:/twitter_locations_n_scraper') > > File > "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", > line 668, in runfile > execfile(filename, namespace) > > File > "C:

tweepy how to get a username from id

☆樱花仙子☆ 提交于 2019-12-08 18:04:24
问题 how do I derrive a plaintext username from a user Id number with tweepy? Here is the CORRECTED code that I am using: ids = [] userid = "someOne" for page in tweepy.Cursor(api.followers_ids, screen_name=userid).pages(): ids.extend(page) time.sleep(60) print len(ids), "following have been gathered from", userid users = api.lookup_users(user_ids=ids)#ieterates through the list of users and prints them for u in users: print u.screen_name The last line I have commented is the one giving me an

“IncompleteRead” Error when retrieving Twitter Data using Python

拜拜、爱过 提交于 2019-12-08 16:29:54
问题 While running this program to retrieve Twitter data using Python 2.7.8 : #imports from tweepy import Stream from tweepy import OAuthHandler from tweepy.streaming import StreamListener #setting up the keys consumer_key = '…………...' consumer_secret = '………...' access_token = '…………...' access_secret = '……………..' class TweetListener(StreamListener): # A listener handles tweets are the received from the stream. #This is a basic listener that just prints received tweets to standard output def on_data

401 error while using tweepy

。_饼干妹妹 提交于 2019-12-08 16:27:05
问题 I am running the below program.But am getting the below error Message. 401 **** 401 **** (keeps on repeating) The code(got from some forum) basically tries to connect to Twitter and fetch tweets. When its ran on ubuntu terminal the 401 error message appear. import sys import json import pymongo import tweepy consumer_key="XX" ##all the keys and codes have to be strings consumer_secret="XX" access_token = "XX" access_token_secret = "XX" # This is the listener, resposible for receiving data

TweepError: Expecting length, unexpected value found pandas jupyter notebook

我的未来我决定 提交于 2019-12-08 14:03:00
问题 This is my code, trying to initialize an instance of a class and I am getting a Tweep Error query = 'vacation' max_tweets = 1000 myStreamListener = MyStreamListener() myStream = tweepy.Stream(auth = api.auth, listener = myStreamListener) myStream.filter(track=[query]) the error that is returned looks like this: TweepError Traceback (most recent call last) <ipython-input-31-227d7853c42e> in <module>() 4 myStreamListener = MyStreamListener() 5 myStream = tweepy.Stream(auth = api.auth, listener

How to track more than a single term in Tweepy?

不想你离开。 提交于 2019-12-08 13:35:31
问题 I am using Tweepy and would like to track two separate terms, 'wordA' and 'wordB' (meaning each tweet will contain either) but I also want to store their results in separate structures. Is it possible to have two separate stream listeners on the same auth object? any code examples demonstrating how to do this would be appreciated. Thanks 回答1: You're only allowed a single stream per user, so you'll have to split them out after the data has been received. I tend to do this in something like the

twitter bot on heroku error “No web processes running” method=GET path=“/favicon.ico”

点点圈 提交于 2019-12-08 11:01:53
问题 I made a twitter bot in python 3.5 using tweepy which updates status about the New followers everyday. The code runs smoothly on IDLE. I tried to deploy the bot on heroku but it keeps throwing error in the logs : at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" dyno= connect= service= status=503 bytes= After going through similar questions, I tried the commands like : heroku ps:scale web=1 but to no avail. Here is my python program named bot.py import tweepy

tweepy “undefined variable” errors

微笑、不失礼 提交于 2019-12-08 10:25:15
问题 I am new to both python and Aptana. I am trying to use the tweepy package in python. I have the following code (from python's site): import tweepy user = tweepy.api.get_user('twitter') # "undefined variable" error occurs on this line print user.screen_name print user.followers_count for friend in user.friends(): print friend.screen_name I get an "Undefined variable from import: get_user". The code actually runs fine with no errors and produces the expected results. I googled and found how to

Searching of public tweets with hashtag in certain period of time

孤街浪徒 提交于 2019-12-08 09:05:10
问题 I am currently working on a project that related to Twitter data. I have read some information about the Twitter API and created a simple client app which aims to retrieve all public tweets containing specific keywords started from August 2013. However, my code does not give any output. I've tried using twitter4j and tweepy. Here is the code that I wrote in Python __author__ = 'adichris' import tweepy from tweepy import Stream from tweepy.streaming import StreamListener from tweepy import