Questions tagged [python-twitter]

A Python wrapper around the Twitter API

This library provides a pure Python interface for the Twitter API.

Twitter provides a service that allows people to connect via the web, IM, and SMS. Twitter exposes a web services API and this library is intended to make it even easier for Python programmers to use.

151 questions
0
votes
2 answers

Collecting old tweets through Tweeter API

I'm going to collect tweets about an event that has been happened 3 years ago, but I read somewhere that Twitter only let its API users to collect tweets not older than a week. So, I'd like to ask if this is true, how can I collect tweets from 3 or…
amiref
  • 3,181
  • 7
  • 38
  • 62
0
votes
1 answer

Python twitter API error for Twitter class

I am trying to use the python twitter API but it can't find the Twitter class. https://pypi.python.org/pypi/twitter For instance I do the following without any errors: from twitter import * But when I do: >>> t = Twitter(auth) Traceback (most…
user2399453
  • 2,930
  • 5
  • 33
  • 60
0
votes
1 answer

Using Twitter Search API with a specific metadata

I've been using the Twitter API (with Python) for quite some time, but I'm unable to search for Twitter users having a specific criterion. For example, the API has several user attributes in the user JSON data it returns, like statuses_count or…
Sam Chats
  • 2,271
  • 1
  • 12
  • 34
0
votes
1 answer

Get all tweets to user python-twitter

Is there a way to get a list of all tweets sent to a twitter user? I know I can get all tweets sent by the user using api.GetUserTimeline(screen_name='realDonaldTrump'), but is there a way to retrieve tweets to that user?
Mike Resoli
  • 1,005
  • 3
  • 14
  • 37
0
votes
1 answer

python-twitter GetSearch giving empty list

My code was working correctly till yesterday and I was able to fetch tweets, from GetSearch(), but now it is returning empty list, though I check my credentials are correct Is something changed recently?? Thank you
daydreamer
  • 87,243
  • 191
  • 450
  • 722
0
votes
1 answer

Python process file and return specific items

Say i have a dict, dict is a dictonary with dictonary as value dict = {'**Leon**':{'Name':'Leon L','**follow**':['Apple', 'PPy','Jack','Tommy']},'**Jack**':{'name':'Jack Y','**follow**':['Apple','Cruise','Jay']},'**Tommy**':{'name':'Tommy…
John
  • 71
  • 2
  • 4
0
votes
2 answers

using variable from returns in python

I am currently using python-twitter module and I want to be able to isolate a string from the return I get with api.GetFollowersPaged(). When I run the code to print the return I get something that looks like this: [User(ID=....,…
jmfp92
  • 3
  • 3
0
votes
1 answer

Getting tweets in twitter-python using using place id

I am trying to get the tweets which contain a particular search term and have been tweeted from Mumbai . I know the place id of Mumbai is: 7929cea6bd5b32bd . I am using python-twitter in python 2.7.9 and the following code: …
0
votes
1 answer

Get URL from media with python-twitter in Django

I'm currently using python-twitter for a personal project, I'm able to retrieve all the filtered data I need (mentions to a set of users) but I need to extract the DisplayURL from the media object. I do a: {% for tweet in tweets %} {{…
0
votes
0 answers

cannot import name is_secure transport

I tried to reinstall and reinstall three times, I tried to pip3 install --upgrade as well, simply no method I tried didn't worked. When I try to import twython or python twitter, I get this error message: Traceback (most recent call last): File…
0
votes
1 answer

Python-Twitter: Can't covert 'bytes' object to string

I am trying to encode tweets from unicode to utf-8 but I get the following error gets logged on CLI when I execute the file: File "PI.py", line 21, in analyze text += s.text.encode('utf-8') TypeError: Can't convert 'bytes' object to str…
0
votes
1 answer

How do I retrieve all my posted tweets using python-twitter?

I'm using python-twitter in my Web Application to post tweets like this: import twitter twitter_api = twitter.Api( consumer_key="BlahBlahBlah", consumer_secret="BlahBlahBlah", access_token_key="BlahBlahBlah", …
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272
0
votes
1 answer

Twitter API query using python Twitter gives few results

I am using Python Twitter to download data from tweets about youTube videos : https://github.com/bear/python-twitter/blob/master/doc/index.rst def TW(): return…
user6403833
  • 269
  • 5
  • 13
0
votes
1 answer

How can I make my Python script sound an alarm when a specified user creates a new tweet?

I am currently experimenting with python-twitter along with the Twitter API, and am making a script that sounds the print "\a" alarm when a user uploads a new tweet. So far I have this function: def tweets(): statuses =…
Ryan Werner
  • 177
  • 3
  • 5
  • 13
0
votes
0 answers

UnicodeEncodeError: unsure of error

I keep getting this error while trying to execute my program. Please note that I am using Python Twitter Tools and will not be posting my full code as it contains information related to my Twitter. Traceback (most recent call last): File…
user4304303