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
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
0 answers

Twitter User Authentication (OAuth 1.1) with Twython and Flask

I have been looking for an explanation on how to do this using this particular set of libraries and couldn't really find anything simple and straightforward enough. Since I have figured out a working way myself, I decided to drop it here for people…
0
votes
1 answer

Twython not importing only English Tweets?

I'm using this method exactly, but when I try to specify just english with lang="en" and every other variation of that I could think of it doesn't work. This is what I'm putting in (even with keywords to limit it further) and it still isn't giving…
rlavalla
  • 1
  • 2
0
votes
1 answer

Remove non utf-8 characters from string in python

I am attempting to read in tweets and write these tweets to a file. However, I am getting UnicodeEncodeErrors when I try to write some of these tweets to a file. Is there a way to remove these non utf-8 characters so I can write out the rest of the…
S. M.
  • 50
  • 2
  • 8
0
votes
0 answers

Python UTF-8 encoding error writing to csv

I know this question has been asked a hundred times. But I am stuck for so many hours that I need help. I stream Twitter Events with the help of a lib called "twython". After streaming I save the tweets in a csv. The tweets are utf-8 encoded and…
hypePG
  • 67
  • 1
  • 8
0
votes
1 answer

Wrong URLs in Entities section of Tweet object

I'm extracting URLs from tweets using Twitter APIs with a Python lib named Twython. I use home_timeline API and look at entities to search for URLs. Normally, the links in entities are correct. However, in some cases, the links are wrong. For…
lenhhoxung
  • 2,530
  • 2
  • 30
  • 61
0
votes
1 answer

Twython replies utilizing expanded character limit

Has anybody had success replying to a tweet with a 140 character reply now that Twitter doesn't count usernames against the character limit? I get the character limit exceeded error in Twython. My tweet is "@username my reply" which seems to be…
Justin S.
  • 11
  • 2
0
votes
1 answer

Twython returning false value for tweet['retweeted']

Hello I just got into Twython. I'm trying to prevent my script from trying to retweet a Tweet multiple times (as this will raise an Error) So I figgured out if you have a tweet the retweeted key should return wether you already retweeted that…
seven_seas
  • 703
  • 4
  • 21
0
votes
1 answer

Trying to go through tweets checking if one already exists twython

for tweets in ExistingTweets: ExistString = tweets['text'] ExistString = ExistString[:15] if randomQuote[:16] == ExistString: randomQuote = AllQuotes[randint(0,5)].getText() randomQuote = randomQuote[printUntil:] I…
T Bruijnen
  • 13
  • 4
0
votes
1 answer

Download User Geo location twitter

I have a list of twitter usernames containing more than 500K in number. I could develop a program that uses twython and API secret keys. The program and Inputs are too large to put here hence uploaded in the Github Twitter_User_Geolocation The…
Sitz Blogz
  • 1,061
  • 6
  • 30
  • 54
0
votes
1 answer

Twython keywords and LEDs

I'm creating a project using a Raspberry Pi and a berry clip. So what I've programmed it to do is (using twython) the code searches for twitters with a particular keyword the user enters and when it finds it, it shows you the tweet and the LED…
jk485921
  • 29
  • 2
  • 9
0
votes
1 answer

Twitter API connection aborted with Twython

i'm trying to download twitter followers from a list of accounts. my function (that uses twython) works pretty well for short account lists but rise an error for longer lists. it is not a RateLimit problem since my function sleeps until the next…
mbiella
  • 51
  • 6
0
votes
1 answer

ImportError: No module named 'Twython'

I am trying to run twython with Python 3.5 but I end up with a "ImportError: No module named 'Twython'" error. import re import time from datetime import datetime from time import gmtime, strftime import csv import json import pymongo from pymongo…
Fawen
  • 1
  • 5
0
votes
1 answer

Does Twitter have a limit on posts from applications?

I'm trying to make a twitterbot that takes and posts pictures. I just ran my program, and it worked, but didn't when I ran it again. I tried a couple more times, stepped away from the computer for a few minutes, and when I came back it worked! But…
0
votes
1 answer

Twython 401 error

Any reason why this code would constantly return a 401 error? I cloned it from here "https://github.com/purplewove/social-media-apis" to test the twython functionality but though I have my twitter keys and secrets, I just get a lot of 401's rather…
user3535074
  • 1,268
  • 8
  • 26
  • 48