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

Parsing Twitter json with Python

I'm using twython library in python to dump public tweets of my own. Data are downloaded in json format refer : https://api.twitter.com/1.1/statuses/home_timeline.json How to print all data line by line, like print "Tweet : %s"…
jOSe
  • 687
  • 11
  • 22
0
votes
1 answer

use get_followers_ids with lookup_user

I have a list of id's stored as type dict_values. I want to use this list as input for lookup-user, but the format doesn't seem to be correct. I know that lookup_user normally accepts a string of comma separated values. Is there any way to convert…
user2993456
0
votes
1 answer

Twython 401 Error for Raspberry Pi Tweetbot

In order to tweet both a photo (taken from the picamera) and a status update, I ran the following code on my raspberry pi: !/usr/bin/env python import sys from twython import Twython import os import pygame import pygame.camera from pygame.locals…
Dgupta
  • 1
0
votes
0 answers

How do I make Twython play nicer with Python to Exe programs?

I've made a program with Twython as the framework for accessing the Twitter Api. It works fine when ran as a python program, but after compiling it with py2exe, pyinstaller, and cxfreeze, it returns the same error: File "twython\endpoints.pyc",…
0
votes
1 answer

Grabbing a users followers with Twython

I have the code to grab a specific users followers as shown below. What I would like to do to further this is not just grab a user's followers but also the followers own followers. An example would be to grab Carl Icahns followers id's and then get…
0
votes
1 answer

Twython Unfollow Script

I have wrote a small script using twython for python that randomly unfollows people however whenever I run the code nothing happens. mfriends = twitter.get_followers_ids(screen_name='myscreenname', count=50) try: for unfollo in mfriends…
0
votes
0 answers

Sign in twitter app for any users (Twython)

I create desktop application to work with twitter. To Authentication in my twitter app I use this code: APP_KEY = '...from my app' APP_SECRET = '...from my app' OAUTH_TOKEN = '...from my app' OAUTH_TOKEN_SECRET = '...from my app' twitter =…
Daniel Petrov
  • 95
  • 3
  • 12
0
votes
1 answer

How to ensure I'm behind the proxy in twython?

I'm using TOR proxy to connect to Twython. But I saw that when I use a false ip:port like 666.666.666.666:666666 it still connects. So, how I can ensure/assert that I'm connected behind the proxy while using twython ? from twython import…
Jeflopo
  • 2,192
  • 4
  • 34
  • 46
0
votes
1 answer

Twython Rate Limit Issue

I am wondering how I can automate my program to fetch tweets at the max rate of 180 requests per 15 minutes, which is equivalent to the max count of 100 per request totaling 18,000 tweets. I am creating this program for an independent case study at…
0
votes
2 answers

Twython - why do I get a key error?

Why do I get a key error? How can I print the screen_name? from twython import Twython CONSUMER_KEY = "123" CONSUMER_SECRET = "123" OAUTH_TOKEN = "123" OAUTH_TOKEN_SECRET = "123" twitter = Twython(CONSUMER_KEY, CONSUMER_SECRET,…
furz
  • 11
  • 2
0
votes
1 answer

How to get tweets from twython?

I'm building a bot that searches for a word in a tweet and then replies to it. This is how far I got: from twython import Twython CONSUMER_KEY = "" CONSUMER_SECRET = "" OAUTH_TOKEN = "" OAUTH_TOKEN_SECRET = "" twitter = Twython(CONSUMER_KEY,…
0
votes
2 answers

Get Tweets by Geolocation using twython

I'm trying to search tweets by geo-location. I'm trying to get tweets in New York using: twitter = Twython(app_key, app_secret, oauth_token, oauth_token_secret) geocode = "42.3482° N, 75.1890° W" search_results =…
Nicole W.
  • 11
  • 4
0
votes
1 answer

Twython error when trying to update twitter status with pic. Gives TypeError: update_status_with_media() takes at least 2 arguments (1 given)

I am using the Twython module and am trying to upload a picture as my status on my Twitter account. from twython import Twython TWITTER_APP_KEY = '#myappkey' TWITTER_APP_KEY_SECRET = '#myappkeysecret' TWITTER_ACCESS_TOKEN =…
Woud28
  • 1
  • 1
0
votes
2 answers

How to base64 encode a picture for twitter in python?

So I have been trying, (without luck) to base64 encode a image to upload to twitter with the Twython library. Iv'e done it the way I know how but it don't seem to work. from twython import Twython import base64 #keys APP_KEY =…
TysonU
  • 432
  • 4
  • 18
0
votes
1 answer

Twython : cursor on statuses/get_user_timeline returns my tweets instead of screen_name passed

I started using Twython recently and was impressed by the simplicity. Thanks for the developing and maintaining the library. However, when I tried running a cursor on get_user_timeline() endpoint, I got my timeline instead of the user specified in…
Atul Kulkarni
  • 135
  • 13