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
2
votes
1 answer

AttributeError: 'Twython' object has no attribute 'destroy_message'

Within the last 2 weeks or so one of my Twitter cleanup scripts stopped working. It appears that there is no longer an attribute for destroy_message which is used to delete sent DMs. Was this removed or renamed? Here is my code and the error. for…
killpacket
  • 21
  • 1
2
votes
0 answers

twython - No module named twython error

I installed tywthon on my raspberry pi using the following command: sudo pip install twython There were no errors during the install. When I run my python file it comes up with: ImportError: No module named twython Code is as follows: import…
Mr_Benn82
  • 21
  • 1
  • 2
2
votes
2 answers

Eclipse + PyDev: Eclipse telling me that this is an invalid import?

I recently installed twython, a really sleek and awesome twitter API wrapper for Python. I installed it and it works fine from the interpreter, but when I try to import it via Eclipse, it says that twython is an invalid import. How do I "tell"…
Alex
  • 64,178
  • 48
  • 151
  • 180
2
votes
1 answer

Using Twython to pull all (of Miley Cyrus') tweets?

I'm new to Python and Twython, but I'm working on a project where I want to use Twython to analyze all of Miley Cyrus' tweets. Currently there are 7,193, but Twython will only let me take 200 at a time...how can I scrape all of them? Is there there…
2
votes
1 answer

How do I get the private IP address of the computer that I am using in python?

Stackoverflow does not seem to have something about public IP addresses in python, so I am asking a question. I have a raspberry pi, and upon start up, I want it to check for its global ip address and its private ip address, and if possible, post it…
user3280859
2
votes
1 answer

Using Twython to 'favorite' a tweet

I'm trying to 'favorite' a tweet using Twython given that I know the tweet's ID, as described in "https://dev.twitter.com/docs/api/1.1" under the "POST favorites/create" section. There seams to be a lot of documentation on how to search, update…
user3006710
  • 3,947
  • 2
  • 12
  • 3
2
votes
1 answer

Using Twython to Convert Multiple User IDs to User Names

I am trying to convert list of Twitter IDs I have into Twitter user names According to the Twitter API document, I am able to submit multiple requests per call. And that parameters for the input should be comma seperated. Below are basically the…
user2330104
  • 61
  • 1
  • 1
  • 6
2
votes
1 answer

Twython connection timeout. How to re-start properly

I want to be able to leave my twython application running for long periods with no user interaction. It simply prints out tweets directed at me. The program is working but after a while I get the following error…
hareti
  • 41
  • 6
2
votes
0 answers

Twython. Issues authenticating [Twitter API returned a 401]

So here is my code so far, I'm not really sure what i'm doing wrong. OAUTH_TOKEN and OAUTH_TOKEN_SECERT print out fine, it's just when it comes to displaying the timeline it seems to of not worked. def login(): APP_KEY = 'xxxxxx' …
George
  • 185
  • 1
  • 9
2
votes
1 answer

twython : get followers list

Using twython I am trying to retrieve list of all of the followers of a particular id which has more than 40k followers. But I am running into below error "Twitter API returned a 429 (Too many requests) rate limit exceeded. How to over come this…
BJC
  • 491
  • 3
  • 21
2
votes
1 answer

Twython search API with next_results

I'm a bit confused about the search API. Let's suppose I query for "foobar", the following code: from twython import Twython api = Twython(...) r = api.search(q="foobar") In this way I have 15 statuses and a "next_results" in r["metadata"]. Is…
petrux
  • 1,743
  • 1
  • 17
  • 30
2
votes
1 answer

How to use Mock to test Twitter API in Django

I have just recently started working with Django as a part of my job. I am completely new to it, and I was working on a practice project while learning django. I ask user to enter a phrase or a word in a search bar, and I return 50 results from…
Arpit
  • 21
  • 1
2
votes
1 answer

Changes to Twython in effect of Twitter REST API version change

I have been trying to extract data from the Twitter API using Twython. Recently, the Twitter API changed version from v1 to v1.1. I do not understand the changes (if any) that need to made in the usage of Twython. I use Twython 2.5.5. The commands I…
Satarupa Guha
  • 1,267
  • 13
  • 20
2
votes
1 answer

Getting a tweet's ID with Twython?

I'm using Twython (Python wrapper for Twitter API, found here.) Objective: I'm trying to make a simple bot that searches for a keyword and replies to tweets with the keyword in them. Example: Send search request to search for #stackoverflow, reply…
Arnav
  • 115
  • 2
  • 11
2
votes
1 answer

Problems fetching authorized tokens with Twython in Safari

I am using Twython to implement OAuth capabilities for my website built with Django. I would like users to be able to register and login using their twitter credentials. I created the basic views for logging in and registering with twitter…
minch
  • 331
  • 3
  • 13