Comments (17)
K this is done. I'm planning to publish a video about it tomorrow.
https://github.com/ykdojo/twitterbotsample
from editdojo.
What account should this bot control?
from editdojo.
this one: https://twitter.com/editdojo
from editdojo.
@ykdojo We can use the Tweepy library along with the Twitter API which we can get through Developer account.
from editdojo.
Okay sounds good. I already got a developer account for @editdojo :)
from 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?
from editdojo.
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?
from editdojo.
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
from editdojo.
from editdojo.
I'm thinking of working on this one next. I'm probably going to make a video about this, too.
from editdojo.
Find some references for this.
The official Tweepy documentation: https://tweepy.readthedocs.io/en/v3.6.0/index.html
A freeCodeCamp article: https://medium.freecodecamp.org/creating-a-twitter-bot-in-python-with-tweepy-ac524157a607
I'll try following them and see if I can understand them first.
from editdojo.
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.
from editdojo.
I'm thinking of putting the keys in a separate Python file and call it keys.py or something.
from editdojo.
So for Twitter API, looks like we have these two choices:
- Filter realtime tweets: https://developer.twitter.com/en/docs/tweets/filter-realtime/overview
- Get Tweet timelines: https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-home_timeline.html
from editdojo.
Ugh looks like Tweepy is not compatible with Python 3.7. Maybe I'll use Python 3.6 instead.
from editdojo.
Turns out, downgrading Python is a huge pain.
So, I used this command instead to install a more recent version of tweepy:
pipenv install -e git+https://github.com/tweepy/tweepy.git@2efe385fc69385b57733f747ee62e6be12a1338b#egg=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
from editdojo.
Just for a reference, here's the video: https://youtu.be/W0wWwglE1Vc
from editdojo.
Related Issues (20)
- When a user signs up for the first time, follow their Twitter account from @EditDojo HOT 3
- When following a user on Twitter, use their ID instead of their handle HOT 3
- Take care of a case when a user's Twitter account is private
- Create a sign up form where the new user selects which language they are learning HOT 24
- Create welcome text that explains how the app works HOT 3
- Make the welcome message look prettier HOT 7
- Decide which CSS framework to use HOT 4
- Take care of the case when a user blocks @EditDojo on Twitter
- Install material-kit (the free version) HOT 1
- Fix the styles of sign up form where the new user selects languages
- [Installation] Keys_format.py instead of keys.py? HOT 2
- In the landing page, the scrolling animation is too slow (I think)
- When the user selects the languages they are learning/fluent in, redirect to a more meaningful page/state HOT 2
- When the user finishes the signup flow, we should show them tweets in the language they're fluent in
- Make a worker script
- Take care of the case when we try to follow someone or retrieve tweets
- Set up HTTPS on Heroku
- Fix the scrolling issue on the phone
- DoesNotExist at /accounts/twitter/login
- Hello YK
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from editdojo.