Skip to content

Instantly share code, notes, and snippets.

@KonradIT
Created February 16, 2019 19:27
Show Gist options
  • Save KonradIT/0bd7243ebe8d7b3e231603880acab7cf to your computer and use it in GitHub Desktop.
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()
@samellou
Copy link

samellou commented Jul 2, 2020

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

@nbendall34
Copy link

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?

@samellou
Copy link

samellou commented Jul 2, 2020

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 !

@nbendall34
Copy link

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

@nbendall34
Copy link

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

@hamzai7
Copy link

hamzai7 commented Jul 3, 2020

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?

@Marscop9013
Copy link

Marscop9013 commented Jul 4, 2020

What do I type On the "how do you plan on using Twitter API"

@nbendall34
Copy link

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."

@nbendall34
Copy link

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?

@hamzai7
Copy link

hamzai7 commented Jul 8, 2020

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.

@Hassanshin
Copy link

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

@Hassanshin
Copy link

Hassanshin commented Aug 11, 2020

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.

image
fill the Website URL guys in the bottom. wait for 3 hours (for me) and done. It works well.. the website is fake tho

@EmMollova
Copy link

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?

@nbendall34
Copy link

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

@mnynbot
Copy link

mnynbot commented Feb 2, 2021

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?

@IndraIsSad
Copy link

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?

@nbendall34
Copy link

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?

@nbendall34
Copy link

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?

@nbendall34
Copy link

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

@IndraIsSad
Copy link

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
image

@nbendall34
Copy link

nbendall34 commented Feb 10, 2021 via email

@gurchpog
Copy link

AAAAAAAAAAAAAAAAAAAAANujQAEAAAAANRMSNOGfQY9BFsG5aeD1XYQHw%2Fg%3DVoL0gLaW3KMZ7vY7nsoqIqZvlIVAEsTd6jeySj8EfOpD6n7gTr

@amelie-gif
Copy link

I want my twitter to be IPhone

me as well how do we do this simply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment