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

Twitter, multiple processes and database

I am a beginner writing a small twitter tool for scheduled tweets and automatic retweets in python/flask. I got stuck with issues of processes running in the background. I want scheduled tweets and retweets to work simultaneously in the background…
Lucas
  • 3
  • 1
  • 7
0
votes
1 answer

Twython - Twitter API returned a 401

First time using Twython and following an example found in the docs here. from twython import Twython APP_KEY='my_key' APP_SECRET='my_secret' twitter = Twython(APP_KEY, APP_SECRET) auth =…
jason m
  • 6,519
  • 20
  • 69
  • 122
0
votes
0 answers

Raspberry Pi LCD Display Retrieve Tweets

I am on a project with a group to create a device that will retrieve tweets and display them on an LCD on a Raspberry Pi platform. We are using a Raspberry Pi 3 model with a Cobbler T and breadboard. We are using the code below and have been trying…
Babeeshka
  • 105
  • 1
  • 4
  • 21
0
votes
1 answer

how do I prevent my list items from being broken up into individual strings when writing to CSV?

When writing to my CSV my list item gets broken up into individual strings even though I am using the append function. I think the problem is in how I am using writerow, but I'm not quite sure. This is my code. twitter =…
Artem Yevtushenko
  • 704
  • 1
  • 9
  • 21
0
votes
2 answers

Twitter streaming API not responding on production, but OK on dev server

I have been listening to the Twitter public stream with Twython with no problem but the production server stopped receiving any tweets for a couple of days. I've created a simple test case: >>> from twython import TwythonStreamer >>> >>> class…
onurmatik
  • 5,105
  • 7
  • 42
  • 67
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
2 answers

How to fetch all the direct messages using Twython?

I am trying to fetch all the direct messages in my account. But I tried to use cursor for fetching. But I'm getting an error like TypeError: cursor() missing 1 required positional argument: 'function' My code is below. from twython import…
Arockia
  • 440
  • 1
  • 6
  • 18
0
votes
1 answer

Obtaining access token error 401 in Twython

I am trying to veify Twitter account of user via Twython def twitter_view(request): twitter = Twython(APP_KEY, APP_SECRET) auth = twitter.get_authentication_tokens(callback_url='http://127.0.0.1:8000/confirm/',…
0
votes
1 answer

Twython 404 on create_list_members method

I have the following code, which gets a list of ids for a users friends on Twitter. These ids as then passed to a newly created list but I'm getting the following error: Traceback (most recent call last): File "twitter.py", line 34, in
Adders
  • 665
  • 8
  • 29
0
votes
2 answers

How do I get the id of the last tweet using twython?

what I want is to eliminate the last tweet, for that I use the following: l = len(sys.argv) if l >= 2: twid = sys.argv[1] else: twid = input("ID number of tweet to delete: ") try: tweet = twitter.destroy_status(id=twid) except…
krowa
  • 1
  • 2
0
votes
0 answers

Twython and Twitter API: Who unfollowed a Twitter User Python Script

I am currently trying to explore Twitter APIs with Twython. I am familiar with get followers, list, and so on. But is there a way I can find out the list of unfollowers for a specific user and their timeline by using Python ? Thanks in Advance
Radhika Nair
  • 141
  • 10
0
votes
1 answer

How do I generate a list of people I follow using Twython?

To get a list of who follows me, I know that I can use: twitter = Twython(CONSUMER_KEY,CONSUMER_SECRET,ACCESS_KEY,ACCESS_SECRET) followers = twitter.get_followers_ids(screen_name = "my_username") but how do I get a list of who I follow?
James Vickery
  • 732
  • 3
  • 10
  • 23
0
votes
1 answer

Twython filters track and follow

i need obtain tweets in real time with filters and certain accounts. I try with this: filtro="messi,copa100,copaamierica" personas="488916863,3034605958" #twitters ids here stream.statuses.filter(track=filtro, follow=[personas]) but only use the…
bcamargo75
  • 115
  • 7
0
votes
1 answer

"TypeError: String Indices must be integers" when using Twython

I'm trying to get tweets by hashtags. It seems to load them but at the point to save the tweet id, I get: "TypeError: String indices must be integers". I think the problem is something like this. My code: from twython import Twython,…
derskye
  • 11
  • 1
0
votes
1 answer

Twitter API Get User ID from Status ID

I am creating a Twitter bot that will follow the creator of a given status. I have the status ID (tweet ID), but I need to grab the user ID of the user who posted the tweet in order to follow them. How can I get this? I am using the Twyton package.