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

How to pass oauth_callback value to oauth/request_token with Twython

Twitter just recently made the following mandatory: 1) You must pass an oauth_callback value to oauth/request_token. It's not optional. Even if you have one already set on dev.twitter.com. If you're doing out of band OAuth, pass…
BuddyTeal
  • 61
  • 6
2
votes
2 answers

Django app using Twython Oauth returns 'AnonymousUser' object has no attribute 'backend'

Django advanced beginner here. I'm banging my head against the wall trying to figure this one out. I have a simple webapp that uses twython_django_oauth tied into contrib.auth to register and login users. (I'm using twython out of the box with no…
MarcusW
  • 35
  • 5
2
votes
1 answer

Twitter developer API access multiple accounts

I applied for a Twitter Developer account on my personal Twitter account, let's call it @personal for this example. I have another account, which I'll call @bot. My personal account has access to the Twitter API, and Twython can access and tweet…
thesimg
  • 328
  • 1
  • 12
2
votes
1 answer

HTTPSConnectionPool(host='api.twitter.com', port=443): Max retries exceeded with url

I am trying to crawl Twitter with Twython, tweepy module according to their documentation. Each time got stuck along with max entries restrictions: #python 3.8.2 #twython 3.8.2 from twython import Twython twitter = Twython(APP_KEY, APP_SECRET, …
Nil Sagor
  • 333
  • 1
  • 8
  • 19
2
votes
0 answers

How to take a photo on pi, replace green screen background w/ image, and post it to twitter?

I want to be able to take a photo with the Raspberry Pi camera, put an image where the green screen is, and post it to twitter. I don't know how to implement it with my current code. Currently, the program takes a photo, overlays a .PNG file on top…
2
votes
1 answer

problem while storing tweets into csv file

I am working with Python attempting to store tweets (more precisely only their date, user, bio and text) related to a specific keyword in a csv file. As I am working on the free-to-use API of Twitter, I am limited to 450 tweets every 15 minutes.…
2
votes
0 answers

TypeError when trying to connect with Twitter API Python

I am trying to post a twitter status update through the python API. My code is the following: consumer_key = "XXXXXX" consumer_secret = "XXXXXXX" access_token = "YYYYYYYY" access_token_secret = "YYYYYYYYY" import tweepy auth =…
Denzo
  • 240
  • 1
  • 7
2
votes
1 answer

ImportError: No module named requests_oauthlib

Trying to tweet on my Raspberry Pi. Installed both Twython and oauthlib without problem. But can't get past this error: Traceback (most recent call last): File "tweet_test.py", line 3, in from twython import Twython File…
Curt Poff
  • 21
  • 1
  • 5
2
votes
1 answer

Twitter upload issues using Twython - Syntax error - Invalid Token

I keep getting an Invalid Token error when I run the following .py. What I'm trying to do it a simple photo booth upload to Twitter. When you press the button, it will take a pic, then upload it. The tokens have been replaced with XXXX. They are…
Jay
  • 23
  • 2
2
votes
1 answer

How can I fix "AttributeError: 'dict' object has no attribute 'append'" in Twython

Im working on learning some python and I wanted to write a script that would pull my followers usernames from my twitter and save it to a file. The script comes from this website…
user7986650
2
votes
1 answer

Twython - get tweets only from one user, not to that user

Fairly new to Twython, hope I'm not sounding too dumb here. Currently I have Twython listening to the Twitter streaming API for tweets from a single user, then triggering a relay to open a door. It's working well, but I've found that it will…
2
votes
1 answer

Twython: How to like photos and follow profiles in the following code

How would you insert the ability to like the posts re-tweeted, along with follow the users that posted. naughty_words = [" -RT"] good_words = ["CSGO", "skins", "csgo giveaway" "csgogiveaway", "CSGOGiveaway", "Giveaway"] filter = " OR…
2
votes
1 answer

How to auto follow someone with Twython

I am making a bot that automatically re-tweets and favorites anything containing the keyword 'Australia' I am successfully able to re-tweet and favorite the tweet automatically, but I have no idea how to follow them automatically (follow everyone I…
Will
  • 147
  • 1
  • 3
  • 10
2
votes
2 answers

Twython returned a 400 (Bad Request) when tweeting an image

I'm writing a small script in python running in Raspbian to tweet a speedtest result and i'm trying to attach the image, this is the code: import sys, urllib, cStringIO from PIL import Image from twython import Twython ... file =…
Alfredo M
  • 568
  • 3
  • 7
  • 26
2
votes
1 answer

ReadTimeoutError: Twitter Streaming API

I want to get some tweets regarding aggressive dogs. My keywords are specified in the code. All of them refer to German shepherd (In Spanish "pastor alemán"). For instance, among other tweets I expect to get this one that perfectly fits the keywords…
Klausos Klausos
  • 15,308
  • 51
  • 135
  • 217
1 2
3
21 22