Giter Site home page Giter Site logo

Comments (17)

ykdojo avatar ykdojo commented on June 27, 2024 1

K this is done. I'm planning to publish a video about it tomorrow.
https://github.com/ykdojo/twitterbotsample

from editdojo.

 avatar commented on June 27, 2024

What account should this bot control?

from editdojo.

ykdojo avatar ykdojo commented on June 27, 2024

this one: https://twitter.com/editdojo

from editdojo.

sameerchoubey avatar sameerchoubey commented on June 27, 2024

@ykdojo We can use the Tweepy library along with the Twitter API which we can get through Developer account.

from editdojo.

ykdojo avatar ykdojo commented on June 27, 2024

Okay sounds good. I already got a developer account for @editdojo :)

from editdojo.

 avatar commented on June 27, 2024

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.

ykdojo avatar ykdojo commented on June 27, 2024

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.

 avatar commented on June 27, 2024

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.

ykdojo avatar ykdojo commented on June 27, 2024

from editdojo.

ykdojo avatar ykdojo commented on June 27, 2024

I'm thinking of working on this one next. I'm probably going to make a video about this, too.

from editdojo.

ykdojo avatar ykdojo commented on June 27, 2024

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.

ykdojo avatar ykdojo commented on June 27, 2024

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.

ykdojo avatar ykdojo commented on June 27, 2024

I'm thinking of putting the keys in a separate Python file and call it keys.py or something.

from editdojo.

ykdojo avatar ykdojo commented on June 27, 2024

So for Twitter API, looks like we have these two choices:

  1. Filter realtime tweets: https://developer.twitter.com/en/docs/tweets/filter-realtime/overview
  2. Get Tweet timelines: https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-home_timeline.html

from editdojo.

ykdojo avatar ykdojo commented on June 27, 2024

Ugh looks like Tweepy is not compatible with Python 3.7. Maybe I'll use Python 3.6 instead.

from editdojo.

ykdojo avatar ykdojo commented on June 27, 2024

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.

ykdojo avatar ykdojo commented on June 27, 2024

Just for a reference, here's the video: https://youtu.be/W0wWwglE1Vc

from editdojo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.