Questions tagged [twython]

An actively maintained, pure Python wrapper for the Twitter API. Supports both the normal and streaming Twitter APIs.

Twython is a library providing an easy (and up-to-date) way to access Twitter data in Python. Actively maintained and featuring support for both Python 2.6+ and Python 3, it's been battle tested by companies, educational institutions and individuals alike.

Full repository on GitHub
Full documentation

Support for:

  • User information
  • Twitter lists
  • Timelines
  • Direct Messages
  • Image Uploading!
    • Updating user status with an image
    • Changing user avatar
    • Changing user background image
    • Changing user banner image
  • Support for Twitter's Streaming API
  • Seamless Python 3 support
317 questions
0
votes
1 answer

'Twython' object has no attribute... Error running examples

I am trying to run the Twython examples in the core_examples folder and I get the same error on all the files. If I run the file: weekly_trends.py I get the error: 'Twython' object has no attribute 'weekly_trends.py'. If I run the file:…
jumpwire
  • 101
  • 1
  • 9
0
votes
1 answer

How to install Pynma & Twython twitter.updateStatusWithMedia UnicodeDecodeError

1st Q is how do i install pynma modules?,where should i put the modules? Im new in Python because usually there is setup.py, but pynma do not have setup.py :( im trying to implement notify my android in raspberry pi and im lost ..…
0
votes
2 answers

twitter.search() query giving error in ipython

I am quite new to the concept of ipython and twython .However i want to retrieve some data using twitter.search query .But when i use it it gives me the following error In [3]: search_results = twitter.search(q="#india",…
Uselesssss
  • 2,127
  • 6
  • 28
  • 37
0
votes
1 answer

search_results not working in ipython

Well i am new to ipython and twython concepts and currently working on twython 2.5.4 now when i give the following code snippet In [101]: search_results = twitter.searchTwitter(q="moon", rpp="50") it gives me the following…
Uselesssss
  • 2,127
  • 6
  • 28
  • 37
0
votes
1 answer

Fetching maximum tweets from twitter using Twython

Well I am new to Twython and through this library I am retrieving tweets, but only 10-15 tweets are getting fetched. The code snippet which I am using to retrieve the tweets is given…
Uselesssss
  • 2,127
  • 6
  • 28
  • 37
0
votes
2 answers

Can't get class as attribute which has one-to-one relationship?

I'm new to Python/Django so forgive me if I overlooked some easy mistakes. I'm trying to use Twython and pretty much copying the code here I can't seem to get the TwitterProfile with the dot syntax like this: user = request.user.twitterprofile It…
heri0n
  • 1,459
  • 3
  • 19
  • 33
0
votes
0 answers

"Forbidden" when getting Direct Messages with twython

twitter = twython.Twython(oauth_token = oauth_token, oauth_token_secret = oauth_secret, app_key = oauth_consumer_key, app_secret =…
sjbrown
  • 562
  • 3
  • 5
0
votes
1 answer

Twython (Python) update_with_media request to Twitter API

I've been using Twython (https://github.com/ryanmcgrath/twython) to tweet photos, description and a link. So on Twitter it is displayed as "...description... ...link... ...pic.twitter.com/XXX..." The problem i have encountered is that these Twitter…
user1588133
-1
votes
1 answer

How can I download tweets of two users in the same time?

I want to download tweets of two users at the same time. So far I' ve downloaded tweets of one user. Here is some code. tweetsL = [] try: user_timeline = twitter.get_user_timeline(screen_name= 'PrimeministerGR', count=100, tweet_mode =…
-1
votes
1 answer

Faster twitter ID stream

My project is to download extremly big number of ID-s from twitter. Also known as, that the average user have small number of followers(100-200). I use for this streaming the Twython package, and here is the main part of my…
John
  • 23
  • 3
-1
votes
1 answer

python KeyError:0

My program streaming data from Twython generates this error: longitude=data['coordinates'][0] KeyError: 0 This occurs in the following code: class MyStreamer(TwythonStreamer): def on_success(self, data): if 'text' in data: …
Jeff Winchell
  • 103
  • 1
  • 8
-1
votes
1 answer

Check if string exists in tweet using Python and Twython

I receiving a stream of tweets. I want to check each tweet and if the tweet contains the word hello I don't want to do anything but if it does not include hello I want to print it. Can't seem to get my code working though. if "hello" not in…
Sami
  • 1,374
  • 1
  • 16
  • 43
-1
votes
1 answer

My code is returning "TwythonErrorYou aren't allowed to add members to this list"

I am writing an Google App Engine application that adds a python list of twitter screen names to a list on twitter. I am using Twython as my Twitter API wrapper. I am able to add some of the screen names from my Python list but not all of them. It…
-1
votes
1 answer

TWYTHON . Getting user name from tweets. Generating friends list from username

I am trying to mine data in a local area. First I would like to Twython to search all tweets on twitter to find those tweets that contain a particular keyword, and then print those tweets. I have successfully written the few lines of code that do…
-1
votes
2 answers

How to continue execution after catching an exception?

I am using twython to get some tweets from twitter. To get the tweets I use try / except, like for follower in followers_file_id: follower = follower.strip() try: if req_user_settings > max_user_settings_req or req_user_tweets >…
Adham
  • 342
  • 1
  • 2
  • 13
1 2 3
21
22