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 403 forbidden error

I am trying to do two things: 1) stream data from twitter 2) update my status based on that data Streaming works fine but every time I try to update my status, I get the a 403 error, forbidden. I get the same response if I use:…
chris
  • 1,869
  • 4
  • 29
  • 52
0
votes
1 answer

Get string from a tweet mentioning a specific user with Twython

I want to make a bot that, upon someone mentioning it (@username) in the tweet, it receives all the text from the tweet and looks for 'on' or 'On' or 'off' or 'Off'. I've setup Twython and have it working and I know how to do everything here except…
0
votes
1 answer

How can I programmatically execute command line commands at a different leveled directory at a certain time interval?

I wrote a web scraper in Scrapy that I call with scrapy crawl scrape_site and a twitter bot in Twython that I call with python twitter.py. I have all the proper files in a directory called ScrapeSite. When I execute these two commands on the command…
Bradley Oesch
  • 763
  • 10
  • 22
0
votes
2 answers

Twython load 3200 tweets and encode it (Cyrillic text)

I wrote small program on Python 3.4.2 with Twython module (3.1.2). It works, but not exactly right. Program loads tweets and display them (you can see code below). It loaded 200 tweets, but I read that Twitter API can give access to 3200 tweets. Can…
Daniel Petrov
  • 95
  • 3
  • 12
0
votes
1 answer

Twython tweet based on string from tweets

I would like to tweet based on when ever a phrase is tweeted. I am using twython and python how can I do this?
SteamPunk_Devil
  • 169
  • 1
  • 8
0
votes
3 answers

Can't get python to compare lists properly

I know it's impolite to include this much code in a question, but this is all necessary to explain the error. Apologies! I'm writing a twitterbot, in python (twython), which is simply supposed to follow anybody who follows my account. It reads in…
Alex
  • 2,270
  • 3
  • 33
  • 65
0
votes
1 answer

How to disconnect the streaming on the exact date & time

I am using Python and TwythonStreamer to stream statuses from Twitter. Currently, I setup a automatic disconnect by counting the number of collected tweets as below: First I set this globally max_tweets = 8000 Then in def on_success(self, tweet) ,…
marcterenzi
  • 319
  • 1
  • 2
  • 10
0
votes
1 answer

Python - Trouble with Twython api

I've written a python script which uses Twython to interact with twitter. It downloads the followers list into a variable (followers), and the list of people I'm following into another variable (friends). It should then automatically follow…
Alex
  • 2,270
  • 3
  • 33
  • 65
0
votes
1 answer

How to Retweet my Main twitter acc using Twython?

I created another twitter acc to help promote my main, so I was wondering how do you retweet ones account using twython are there any examples? I found a few but I'm still a little confused? thanks! What I am trying…
0
votes
1 answer

Streaming tweets using Twython keeps breaking with chunkedencodingerror

I'm relatively new to programming but just trying to get a feel with working for apis/data by pulling tweets from twitter using the Twython twitter wrapper. every time I do this I get the following error messages around 5,000 tweets. I can use the…
imightlose
  • 15
  • 4
0
votes
1 answer

Google app Engine with Twython Library on Python

I am trying to build a twitter app on google appengine using Python. I have used a Python Library called Twython to make the app on my Python script. However, when I try to use it in conjunction with google appengine, the application doesn't build…
0
votes
1 answer

Twitter image bot posts every 2 hours

This is a twitter image bot that is called on every two hours to post a picture from a folder, the files are numbered consecutively and the current number is stored in a text file so it can stay constant between the runs. The image file types vary…
user3166930
0
votes
2 answers

Manipulate Pandas DataFrame containing dictionaries from Twitter API

I am working on a script that uses the Twitter API to pull recent statuses from a list of users. I am able to retrieve the data using the API however upon converting it to a DataFrame, I get columns that are storing dictionaries. I want to spread…
blahblahblah
  • 2,299
  • 8
  • 45
  • 60
0
votes
1 answer

writing json stream to file limits output size

So I am writing a simple python stream listener using twython (EDIT: python Twitter client library), when runnining the .py the output file-size oscillates between 1 and 5kb. I would like to know what to do to make sure the file keeps getting…
bmf
  • 55
  • 1
  • 7
0
votes
1 answer

429 error while fetching Twitter follows for a user using Twython

I have seen a few things on the site trying to help with this issue but I couldn't make head or tail as to what I'm doing wrong. This bit of code is supposed to get a list of followers but no matter what I try I get a 429 error from the Twitter…
bricky149
  • 81
  • 1
  • 1
  • 8