-
-
Save KonradIT/0bd7243ebe8d7b3e231603880acab7cf to your computer and use it in GitHub Desktop.
#!/usr/bin/env python | |
import sys, os, time | |
import tweepy | |
keys = dict( | |
consumer_key='_YOUR_CONSUMER_KEY', | |
consumer_secret='_YOUR_SECRET_KEY', | |
access_token='_YOUR_ACCESS_TOKEN', | |
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET' | |
) | |
user = "@YOUR_USERNAME" | |
auth = tweepy.OAuthHandler(keys['consumer_key'], keys['consumer_secret']) | |
auth.set_access_token(keys['access_token'], keys['access_token_secret']) | |
api = tweepy.API(auth) | |
def tweet(): | |
message=input("tweet: ") | |
api.update_status(message) | |
time.sleep(1000) | |
if __name__ == "__main__": | |
while 1: | |
tweet() |
[Help??] Ok so I got the command to "work" in that it will give the prompt to enter my tweet but one I enter in the tweet it gives errors:
Traceback (most recent call last):
File "C:/Users/{My Name}/AppData/Roaming/JetBrains/PyCharmCE2020.1/scratches/scratch.py", line 23, in
tweet()
File "C:/Users/{My Name}/AppData/Roaming/JetBrains/PyCharmCE2020.1/scratches/scratch.py", line 19, in tweet
api.update_status(message)
File "C:\Users{My Name}\Desktop\idktweet\venv\lib\site-packages\tweepy\api.py", line 186, in update_status
return bind_api(
File "C:\Users{My Name}\Desktop\idktweet\venv\lib\site-packages\tweepy\binder.py", line 250, in _call
return method.execute()
File "C:\Users{My Name}\Desktop\idktweet\venv\lib\site-packages\tweepy\binder.py", line 233, in execute
raise TweepError(error_msg, resp, api_code=api_error_code)
tweepy.error.TweepError: [{'code': 89, 'message': 'Invalid or expired token.'}]
Also when I first started the code said that the imports of sys and os were invalid
tweepy.error.TweepError: [{'code': 89, 'message': 'Invalid or expired token.'}]
Have you tried creating a new project in the Twitter Developers Portal
tweepy.error.TweepError: [{'code': 89, 'message': 'Invalid or expired token.'}]
Have you tried creating a new project in the Twitter Developers Portal
Ok yeah that worked, thanks for the help!
tweepy.error.TweepError: [{'code': 89, 'message': 'Invalid or expired token.'}]
Have you tried creating a new project in the Twitter Developers Portal
Ok yeah that worked, thanks for the help!
No problem man!
tweepy.error.TweepError: [{'code': 89, 'message': 'Invalid or expired token.'}]
Have you tried creating a new project in the Twitter Developers Portal
Ok yeah that worked, thanks for the help!
help I got an error.....
KeyError you most likely put the wrong keys in try generating new ones
I am trying this but this is what i am getting. https://imgur.com/Xy5Bshq
First, create or download this file: Main.py
Secondly, Change the following definitions to your keys and secrets:consumer_key='_YOUR_CONSUMER_KEY',
consumer_secret='_YOUR_SECRET_KEY',
access_token='_YOUR_ACCESS_TOKEN',
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET'
Third, Enter your username
Final, hit F5 to run!Reply to this is you need any help!
Okay, so the script worked but the tweet on my account doesn't show any device at all. Is something wrong on my developer account side of things ?
I have the same problem i need some help
I am trying this but this is what i am getting. https://imgur.com/Xy5Bshq
First, create or download this file: Main.py
Secondly, Change the following definitions to your keys and secrets:
consumer_key='_YOUR_CONSUMER_KEY',
consumer_secret='_YOUR_SECRET_KEY',
access_token='_YOUR_ACCESS_TOKEN',
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET'
Third, Enter your username
Final, hit F5 to run!
Reply to this is you need any help!
Okay, so the script worked but the tweet on my account doesn't show any device at all. Is something wrong on my developer account side of things ?I have the same problem i need some help
Hi all, Have you tired creating a new application in the Twitter Developers Portal?
I am trying this but this is what i am getting. https://imgur.com/Xy5Bshq
First, create or download this file: Main.py
Secondly, Change the following definitions to your keys and secrets:
consumer_key='_YOUR_CONSUMER_KEY',
consumer_secret='_YOUR_SECRET_KEY',
access_token='_YOUR_ACCESS_TOKEN',
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET'
Third, Enter your username
Final, hit F5 to run!
Reply to this is you need any help!
Okay, so the script worked but the tweet on my account doesn't show any device at all. Is something wrong on my developer account side of things ?I have the same problem i need some help
Hi all, Have you tired creating a new application in the Twitter Developers Portal?
I tried and it worked, thanks !
I am trying this but this is what i am getting. https://imgur.com/Xy5Bshq
First, create or download this file: Main.py
Secondly, Change the following definitions to your keys and secrets:
consumer_key='_YOUR_CONSUMER_KEY',
consumer_secret='_YOUR_SECRET_KEY',
access_token='_YOUR_ACCESS_TOKEN',
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET'
Third, Enter your username
Final, hit F5 to run!
Reply to this is you need any help!
Okay, so the script worked but the tweet on my account doesn't show any device at all. Is something wrong on my developer account side of things ?
I have the same problem i need some help
Hi all, Have you tired creating a new application in the Twitter Developers Portal?I tried and it worked, thanks !
No problem Man
UPDATE
Hi all, I know KonradIT runs this Gist but he hasn't touched it in 17 months. Below is a Repository that I have created that explains in full how to get your bot up and running. If you have any issues, Mark them in the repo. Hope you enjoy:
https://github.com/nbendall34/TwitterDeviceHandleChanger
I am trying this but this is what i am getting. https://imgur.com/Xy5Bshq
First, create or download this file: Main.py
Secondly, Change the following definitions to your keys and secrets:
consumer_key='_YOUR_CONSUMER_KEY',
consumer_secret='_YOUR_SECRET_KEY',
access_token='_YOUR_ACCESS_TOKEN',
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET'
Third, Enter your username
Final, hit F5 to run!
Reply to this is you need any help!
Okay, so the script worked but the tweet on my account doesn't show any device at all. Is something wrong on my developer account side of things ?I have the same problem i need some help
Hi all, Have you tired creating a new application in the Twitter Developers Portal?
Hi, I've tried creating a new app and a new project but the tweet still doesn't show any device at all. Is there anything else that I can do to fix this?
What do I type On the "how do you plan on using Twitter API"
What do I type On the "how do you plan on using Twitter API"
"I want to use the Twitter API to get a bot to tweet user input but change the source label so it doesn't show "Twitter for iPhone/Android" This will be done using Python and Tweepy for simplification."
I am trying this but this is what i am getting. https://imgur.com/Xy5Bshq
First, create or download this file: Main.py
Secondly, Change the following definitions to your keys and secrets:
consumer_key='_YOUR_CONSUMER_KEY',
consumer_secret='_YOUR_SECRET_KEY',
access_token='_YOUR_ACCESS_TOKEN',
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET'
Third, Enter your username
Final, hit F5 to run!
Reply to this is you need any help!
Okay, so the script worked but the tweet on my account doesn't show any device at all. Is something wrong on my developer account side of things ?I have the same problem i need some help
Hi all, Have you tired creating a new application in the Twitter Developers Portal?
Hi, I've tried creating a new app and a new project but the tweet still doesn't show any device at all. Is there anything else that I can do to fix this?
Any runtime errors?
I am trying this but this is what i am getting. https://imgur.com/Xy5Bshq
First, create or download this file: Main.py
Secondly, Change the following definitions to your keys and secrets:
consumer_key='_YOUR_CONSUMER_KEY',
consumer_secret='_YOUR_SECRET_KEY',
access_token='_YOUR_ACCESS_TOKEN',
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET'
Third, Enter your username
Final, hit F5 to run!
Reply to this is you need any help!
Okay, so the script worked but the tweet on my account doesn't show any device at all. Is something wrong on my developer account side of things ?I have the same problem i need some help
Hi all, Have you tired creating a new application in the Twitter Developers Portal?
Hi, I've tried creating a new app and a new project but the tweet still doesn't show any device at all. Is there anything else that I can do to fix this?
Any runtime errors?
I don't get any errors errors at all. It runs perfectly except for the tweet not showing where it was posted from.
I am trying this but this is what i am getting. https://imgur.com/Xy5Bshq
First, create or download this file: Main.py
Secondly, Change the following definitions to your keys and secrets:consumer_key='_YOUR_CONSUMER_KEY',
consumer_secret='_YOUR_SECRET_KEY',
access_token='_YOUR_ACCESS_TOKEN',
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET'
Third, Enter your username
Final, hit F5 to run!Reply to this is you need any help!
Same problems. Tweeting works. But not showing my app
I am trying this but this is what i am getting. https://imgur.com/Xy5Bshq
First, create or download this file: Main.py
Secondly, Change the following definitions to your keys and secrets:
consumer_key='_YOUR_CONSUMER_KEY',
consumer_secret='_YOUR_SECRET_KEY',
access_token='_YOUR_ACCESS_TOKEN',
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET'
Third, Enter your username
Final, hit F5 to run!
Reply to this is you need any help!
Okay, so the script worked but the tweet on my account doesn't show any device at all. Is something wrong on my developer account side of things ?I have the same problem i need some help
Hi all, Have you tired creating a new application in the Twitter Developers Portal?
Hi, I've tried creating a new app and a new project but the tweet still doesn't show any device at all. Is there anything else that I can do to fix this?
Any runtime errors?
I don't get any errors errors at all. It runs perfectly except for the tweet not showing where it was posted from.
fill the Website URL guys in the bottom. wait for 3 hours (for me) and done. It works well.. the website is fake tho
I am trying this but this is what i am getting. https://imgur.com/Xy5Bshq
First, create or download this file: Main.py
Secondly, Change the following definitions to your keys and secrets:
consumer_key='_YOUR_CONSUMER_KEY',
consumer_secret='_YOUR_SECRET_KEY',
access_token='_YOUR_ACCESS_TOKEN',
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET'
Third, Enter your username
Final, hit F5 to run!
Reply to this is you need any help!
Okay, so the script worked but the tweet on my account doesn't show any device at all. Is something wrong on my developer account side of things ?I have the same problem i need some help
Hi all, Have you tired creating a new application in the Twitter Developers Portal?
Hi, I've tried creating a new app and a new project but the tweet still doesn't show any device at all. Is there anything else that I can do to fix this?
I have the same problem (tweet not showing) and it gives me this as an error: https://imgur.com/a/9K2ZaZj
Anything I could've done wrong?
I am trying this but this is what i am getting. https://imgur.com/Xy5Bshq
First, create or download this file: Main.py
Secondly, Change the following definitions to your keys and secrets:
consumer_key='_YOUR_CONSUMER_KEY',
consumer_secret='_YOUR_SECRET_KEY',
access_token='_YOUR_ACCESS_TOKEN',
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET'
Third, Enter your username
Final, hit F5 to run!
Reply to this is you need any help!
Okay, so the script worked but the tweet on my account doesn't show any device at all. Is something wrong on my developer account side of things ?I have the same problem i need some help
Hi all, Have you tired creating a new application in the Twitter Developers Portal?
Hi, I've tried creating a new app and a new project but the tweet still doesn't show any device at all. Is there anything else that I can do to fix this?
I have the same problem (tweet not showing) and it gives me this as an error: https://imgur.com/a/9K2ZaZj
Anything I could've done wrong?
This is a tweepy error, try reinstalling via pip
When creating your twitter application, name the app what you want the source tag to be. NOTE: renaming your existing app will not change it in tweepy
Any solution on how to do this if I already have an existing app?
I have the same problem (tweet not showing) and it gives me this as an error: https://imgur.com/a/9K2ZaZj
Anything I could've done wrong?This is a tweepy error, try reinstalling via pip
https://cozy-says.anime-girls-are-the.best/3UF0HaW8 I've tried and my application is on all permissions, what happened?
I have the same problem (tweet not showing) and it gives me this as an error: https://imgur.com/a/9K2ZaZj
Anything I could've done wrong?This is a tweepy error, try reinstalling via pip
https://cozy-says.anime-girls-are-the.best/3UF0HaW8 I've tried and my application is on all permissions, what happened?
That link look very dodgy, is it shortened?
I have the same problem (tweet not showing) and it gives me this as an error: https://imgur.com/a/9K2ZaZj
Anything I could've done wrong?This is a tweepy error, try reinstalling via pip
https://cozy-says.anime-girls-are-the.best/3UF0HaW8 I've tried and my application is on all permissions, what happened?
Can you pastebin/message me your code (without api keys) for me to look at?
When creating your twitter application, name the app what you want the source tag to be. NOTE: renaming your existing app will not change it in tweepy
Any solution on how to do this if I already have an existing app?
You can pull the Application Keys from an existing app
I have the same problem (tweet not showing) and it gives me this as an error: https://imgur.com/a/9K2ZaZj
Anything I could've done wrong?This is a tweepy error, try reinstalling via pip
https://cozy-says.anime-girls-are-the.best/3UF0HaW8 I've tried and my application is on all permissions, what happened?
Can you pastebin/message me your code (without api keys) for me to look at?
I've managed to fix it (by creating a new app) but now there is another error - It doesn't show the "Twitter for {insert here}" text
AAAAAAAAAAAAAAAAAAAAANujQAEAAAAANRMSNOGfQY9BFsG5aeD1XYQHw%2Fg%3DVoL0gLaW3KMZ7vY7nsoqIqZvlIVAEsTd6jeySj8EfOpD6n7gTr
I want my twitter to be IPhone
me as well how do we do this simply
my brain is too small for this i just wanna tweet from billie joe’s foot bruh