tweepy

how to return all tweets without providing a search query

本小妞迷上赌 提交于 2019-12-12 03:54:35
问题 I am working on a text mining project that deals with analyzing tweets. I would like to get all tweets tweeted in english during a short period of time(not more than a day), without having the result matching to a specific search query, trend, or user criteria. I am familiar with tweepy's api.search function. However, when i try to run it without a search query: api.search(count=remaining_tweets, since_id=str(since_id),lang='en', max_id=str(max_id-1)) i get the following message: "exception

TypeError: __init__() got an unexpected keyword argument 'wait_on_rate_limit'

核能气质少年 提交于 2019-12-12 01:49:06
问题 I am trying to harvest twitter data with respect to Latitude and Longitude but I happen to get error. I am trying to avoid the tweet count limit and also the timing limit of scraping. Code: import tweepy from tweepy import Stream from tweepy import OAuthHandler from tweepy.streaming import StreamListener import pandas as pd import json import csv import sys import time reload(sys) sys.setdefaultencoding('utf8') ckey = 'XYZ' csecret = 'XYZ' atoken = 'XYZ' asecret = 'XYZ' OAUTH_KEYS = {

Retrieving Twitter data using Tweepy

拈花ヽ惹草 提交于 2019-12-11 22:27:11
问题 I'm using that Python code using Tweepy Library to retrieve Twitter data for a specific hashtag, but the question is i need to retrieve a specific period, for example, from 30 june2013 till 30 December 2013. How can I do that? #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

Tweepy update status with media -UnicodeDecodeError: 'ascii' codec can't decode error

风流意气都作罢 提交于 2019-12-11 13:58:47
问题 Using Tweepy to update twitter post with photo. Update with status alone works fine. I am building my file name / path in Windows as follows: path = 'C:/Users/foo/Documents/media/' photoname = 'photo1.jpg' filename = path + photoname This prints out as a nicely formatted path and copied into Windows Explorer, opens the photo, so the path and photo name are correct. However, when I execute with the filename in the update_with_media: api.update_with_media(filename, status=tweet) I get the

Tweepy: simple script with 'Bad Authentication data' error

别来无恙 提交于 2019-12-11 13:25:14
问题 Is this really an authentication problem or has it to do with something else? What do I have to modify to get rid of the error? #!/usr/bin/env python import tweepy ckey = 'xxx' csecret = 'xxx' atoken = 'xxx' asecret = 'xxx' auth = tweepy.OAuthHandler(ckey, csecret) auth.set_access_token(atoken, asecret) api = tweepy.API(auth) results = tweepy.api.search(geocode='50,50,5mi') for result in results: print result.text print result.location if hasattr(result, 'location') else "Undefined location"

Error installing tweepy on windows

为君一笑 提交于 2019-12-11 09:10:55
问题 I am new to Python and tweepy. I have tried searching for an answer but haven't been able to get this working. I have Java 6 (can't change to 7, for another project), python 2.7 and I have downloaded and extracted tweepy in my C drive. Java and python are both in the PATH variables. I am trying to install tweepy and I keep getting this error. C:\>cd C:\tweepy C:\tweepy>python Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits"

401 error using the Streaming features of Twitter API (through Tweepy)

£可爱£侵袭症+ 提交于 2019-12-11 06:17:11
问题 I've got an application which takes advantage of a number of features of the Twitter API. I've tested the application on one Windows 7 system, and all features worked well. Testing the application on a second Windows 7 system, it seems that everything but the Public Stream and User Stream features is working (i.e. the app managed to authenticate, can follow/unfollow users, etc). On this system, the Stream features produce a 401 error. As I understand it, 401 could indicate an authorization

Correct directory for Tweepy API to add to the PythonPath

痴心易碎 提交于 2019-12-11 05:59:38
问题 Setup iMac 10.7.4, Eclipse Indigo, Pydev, Python 2.7 I’m trying to install the Tweepy API but the documentation is a bit sparse for any beginner programmer. I thought I had it installed as I had downloaded the necessary file to my applications folder and typed 'python setup.py install' However I’m only now learning about the Pythonpath and the correct way of using import Can anyone tell me where I should locate the Tweepy folder so that I can add it to the PythonPath My Python "System libs"

tkinter.TclError: character U+1f449 is above the range (U+0000-U+FFFF) allowed by Tcl

安稳与你 提交于 2019-12-11 02:49:28
问题 I am trying to show my twitter timeline on Tkinter window using tweepy. This is the code import tweepy import tkinter consumer_key = 'xxxxxxxxxxxxxx' consumer_sec ='xxxxxxxxxxxxxxxxxxxxxxxxxxxxx' acc_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' acc_token_sec = 'xxxxxxxxxxxxxxxxxxxxxx' auth = tweepy.OAuthHandler(consumer_key,consumer_sec) auth.set_access_token(acc_token,acc_token_sec) api = tweepy.API(auth) tweets = api.home_timeline() tkwindow = tkinter.Tk() for tweet in tweets: i

ImportError: No module named 'tweepy.streaming'; 'tweepy' is not a package

拥有回忆 提交于 2019-12-11 00:00:02
问题 I wrote this tweepy sourcecode in PyCharm ed 4. from __future__ import absolute_import, print_function from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream consumer_key="***" consumer_secret="***" access_token="***" access_token_secret="***" class StdOutListener(StreamListener): def on_data(self, data): print(data) return True def on_error(self, status): print(status) if __name__ == '__main__': l = StdOutListener() auth = OAuthHandler(consumer