-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make a simple Twitter bot with Python #14
Comments
What account should this bot control? |
this one: https://twitter.com/editdojo |
@ykdojo We can use the Tweepy library along with the Twitter API which we can get through Developer account. |
Okay sounds good. I already got a developer account for @editdojo :) |
To set up Tweepy we need the consumer key, consumer secret, a access token and a access token secret. Is publicly posting these keys and tokens from the editdojo account a security risk? |
Yeah I think it's best to put those files in .gitignore. Then, each of us can get a Twitter dev account separately and test it with our own Twitter account? |
I was thinking the consumer information could be stored into a config.json file, and change the .gitignore to ignore it. This way we each only need to create the json file with the four required info. Or is there a better way to store this information |
That sounds like a good method!
…On Wed, Oct 24, 2018 at 5:41 PM Kyle McCullen ***@***.***> wrote:
I was thinking the consumer information could be stored into a config.json
file, and change the .gitignore to ignore it. This way we each only need to
create the json file with the four required info. Or is there a better way
to store this information
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABukw3ESCWv2QjIiGMDs0HoEd9NGkvxfks5uoN5ogaJpZM4X4ZPs>
.
|
I'm thinking of working on this one next. I'm probably going to make a video about this, too. |
Find some references for this. The official Tweepy documentation: https://tweepy.readthedocs.io/en/v3.6.0/index.html I'll try following them and see if I can understand them first. |
The freeCodeCamp article was kind of follow, but I found another article on this topic. https://dev.to/emcain/how-to-set-up-a-twitter-bot-with-python-and-heroku-1n39 This looks more promising. Will take a look at it tomorrow morning, I think. |
I'm thinking of putting the keys in a separate Python file and call it keys.py or something. |
So for Twitter API, looks like we have these two choices:
|
Ugh looks like Tweepy is not compatible with Python 3.7. Maybe I'll use Python 3.6 instead. |
Turns out, downgrading Python is a huge pain. So, I used this command instead to install a more recent version of tweepy:
I found a related command for this here: tweepy/tweepy#1063 I also used this as a reference: https://realpython.com/pipenv-guide/#example-usage |
K this is done. I'm planning to publish a video about it tomorrow. |
Just for a reference, here's the video: https://youtu.be/W0wWwglE1Vc |
This is just so that we can learn how to use Twitter API.
Maybe something that says "hello, world back to you!" when it receives a Twitter mention that says "hello, world!"
The text was updated successfully, but these errors were encountered: