317 questions
0
votes
0
answers
57
views
TwythonAuthError: Twitter API returned a 401 (Unauthorized), Could not authenticate
I want to use Twitter API for my project, but I have faced a problem, I cannot really solve. I also use twython. I Forked the Project from this: https://github.com/EnyanDai/FakeHealth
I got the ...
0
votes
0
answers
78
views
How to add multiple images to a tweet in python?
I can tweet adding one image using Twython like so:
twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
# twitter: upload media
gif = open('ex.gif', 'rb')
response =...
0
votes
1
answer
1k
views
Twitter API returned a 401 (Unauthorized), Could not authenticate you
I simply want to post a tweet from my Raspberry Pi and keep getting a 401 error.
-----------------------------------------This is my code-----------------------------------------
import sys
from ...
0
votes
0
answers
114
views
401 Unauthorized Error Twitter Bot in Python
Ok I am making a twitter bot in Python Here is the code -
from twython import Twython, TwythonError
import requests
APP_KEY = ""
APP_SECRET = ""
twitter = Twython(APP_KEY, ...
1
vote
1
answer
165
views
Stop Twitter streaming by timer with twython
I have a code that receives tweets and writes them to csv files. I want to stop this process after a certain amount of time. How can I add a timer to the program. Probably for this you need to use ...
0
votes
1
answer
84
views
Twython returns less retweets than retweets shown on tweet
So I am using Twython to get retweeters of a tweet
tweet = self.twitter.show_status(id=tweet_id)
if tweet.get('retweet_count') > 0:
try:
retweets = self.twitter.get_retweets(...
-1
votes
1
answer
105
views
How can I download tweets of two users in the same time?
I want to download tweets of two users at the same time.
So far I' ve downloaded tweets of one user. Here is some code.
tweetsL = []
try:
user_timeline = twitter.get_user_timeline(screen_name= '...
0
votes
1
answer
98
views
How can I get/access the 'name' attribute from the user data dictionary in twitter in python?
I've downloaded some tweets with Twython.
I want to get/access only the 'name' attribute from the 'user' object dictionary (e.g. {'id': 540179903, 'id_str': '540179903', 'name': 'Makis Voridis' etc.
...
0
votes
1
answer
46
views
How can I set a limit to the tweets I want to download?
I downloaded the tweets I want but my code is running infinity. The Google Collab environment said that I cannot interrupt the code. How can I stop the code from running without canceling it?
Here is ...
2
votes
1
answer
2k
views
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 ...
0
votes
1
answer
59
views
How to "like" Direct Messages using the Twython Python library?
Using the Twython Python library, I discovered that I can send Direct Messages (DM) leveraging the following code:
api.send_direct_message(event={'type':'message_create','message_create':{'target':{'...
0
votes
1
answer
76
views
Receiving 401 error in Twython when trying to get tweets
I'm trying to get the most recent 100 tweets from certain Twitter users on my dev account. I have verified that the credentials work because I can use the API for other tasks. However, the code below ...
0
votes
0
answers
35
views
Using twython to log all screen_names of users who posted about a certain keyword on a certain date
I am trying to print all screen_names found on a search result with Twython.
Here is my current code
#Import the required modules
from twython import Twython
#Setting the OAuth
Consumer_Key = ''
...
1
vote
1
answer
365
views
How to get more than 100 tweets using twython python
I am scraping the data from tweeter using a hashtag. My code below works perfectly. However, I would like to get 10 000 tweets and save them in the same JSON folder (Or save them in separate folder ...
0
votes
1
answer
1k
views
How to save tweeter data in json file?
I am scraping the data from tweeter using Twython. I could get this done successfully. However, for further data manipulation, I need to save the tweeter data to JSON or any other format that can be ...