Questions tagged [python-twitter]

A Python wrapper around the Twitter API

This library provides a pure Python interface for the Twitter API.

Twitter provides a service that allows people to connect via the web, IM, and SMS. Twitter exposes a web services API and this library is intended to make it even easier for Python programmers to use.

151 questions
0
votes
1 answer

python-twitter error with api.PostDirectMessage

I was testing out code for python-twitter, and everything seems okay until I tried to get it to post a direct message to an id. api.PostDirectMessage(3517181843, "some text test") Which then returns Traceback (most recent call last): File…
Cherie
  • 21
  • 5
0
votes
0 answers

Tweepy DM methods do not return DMS

Title says it all. If I use print(api.list_direct_messages(count = 20)), the result is just [], despite receiving many DMs. get.direct.message(id) has also not worked, since I haven't figured out how to find the ID of a specific direct…
0
votes
1 answer

I am trying to store twitter trends into a text file but getting errors before storing into a .txt file

my_trends = api.GetTrendsWoeid(my_woe_id) trends = json.loads(my_trends) but I get error : raise TypeError(f'the JSON object must be str, bytes or bytearray, ' TypeError: the JSON object must be str, bytes or bytearray, not list . I am using…
0
votes
1 answer

python-twitter stream raises JSONDecodeError

When calling for the next tweet of the stream with next(), the following error occurs. When I try calling other functions with the same twitter API object, such as GetFriends(), it works fine. Any help is much appreciated! Here is the…
Carlos
  • 51
  • 7
0
votes
0 answers

How to get a list with my Twitter Followers?

I am trying to get a list with the names of all my Twitter followers. Using the below code I can withdraw only 200 followers name. I know the count parameter can get up to 200 value, but Does anyone know how to withdraw more? from twython import…
Viorel
  • 39
  • 7
0
votes
3 answers

How can I save tweets of a user as images?

There is a Twitter user who posts valuable stuff and I want to save his tweets not as text but as images (screenshots) just as you see it on your phone or computer. I installed python-twitter and tweepy but I didn't find a solution in the docs and…
Jonas
  • 115
  • 7
0
votes
1 answer

Python-twitter API help

I have just started using the python-twitter API and it requires me to register the app for the authorization using OAuth. But when i register with twitter it asks for a Application website. Now the app I am creating is very basic I don't wish to…
Jonah
  • 2,097
  • 4
  • 20
  • 22
0
votes
0 answers

Twitter API - Request Delay Issue - Random Delay? - Python Requests

Once I send my requests they comeback instantly but there seems to be an issue where I get a random delay in between requests out of no where!? I really do require there to be no delay, looking for all the help I can get! import requests from…
0
votes
1 answer

How to post a tweet with an image to a website without including the URL in the tweet body?

I used Feedburner to automatically tweet new posts on my blog, but Feedburner stopped working and I want to write my own code to do the same. The Feedburner tweets looked like this: the post title followed by a short excerpt and a clickable image…
Ricardo
  • 59
  • 1
  • 3
0
votes
0 answers

Getting a search parameter from HTML to Python Flask Function

pretty new to flask and ajax and was wondering if i could get some help. I am using python-twitter and want to be able to type in a search parameter that will search twitter for the requested word/words. I have tried multiple solutions and both my…
0
votes
0 answers

python twitter filter hometimeline

I am writing a function that filter the keyword of my timeline using python-twitter. I do not know how to filter tweets in my timeline. should I use GetSearch(term=keyword)? import twitter api = twitter.Api(my keys) timelines =…
Sean
  • 1
0
votes
0 answers

I am working on twitter API and getting error: TwitterError: [{u'message': u'Invalid or expired token.', u'code': 89}]

code: import twitter consumer_key = 'xyz' consumer_secret = 'xyz' access_token = 'xyz-xyz' access_token_secret = 'xyz' my_api = twitter.Api(consumer_key='consumer_key', consumer_secret='consumer_secret', …
Bhupinder Yadav
  • 346
  • 3
  • 8
0
votes
1 answer

How can I save the result from searchtweets into json files using python?

I am recently working on twitter analysis and want to save the results from twitter search locally into .json files. I am doing both historical search using "searchtweets" and streaming using "tweepy". The result I get are objects which are slightly…
Liang Hu
  • 3
  • 1
0
votes
1 answer

How to get ID by username - Twitter API Python

I'm creating an application with the Python Twitter API Package (python-twitter) but need to convert from username @username to ID bunch_of_letters. I've searched far and wide in the docs but just couldn't find how to do this. Would I need to just…
Aimarekin
  • 331
  • 1
  • 4
  • 18
0
votes
1 answer

For each trend in list, pull the 1000 most recent tweets using python-twitter (And remove/exclude retweets)

Using python-twitter library (https://github.com/bear/python-twitter) I am trying to retrieve the 1000 most recent tweets for the top 10 trends in a location using the yahoo Where on earth ID but can't seem to figure out how to retrieve the tweets…
PapaSmurf
  • 43
  • 8