wigsnes / TwitterContentReplyBot

This application will be a learning experience in using the twitter API. The objective will be to create a bot that replies to users with media content that is related to the tweet that they posted. For example if the tweet has the phrase "It was a good day", it will reply with a Youtube link to the music video it was a good day by ice cube.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Twitter Content Reply Bot

Hacktoberfest

Please read the CONTRIBUTING.md file to find out how you can help out.

Running the bot

Using mock data

If you wish to use mock data, first make sure that

DEBUG = True

in the twitter.py file.
If yes, or after setting it to True, run

python twitter.py

This will go through each users tweet and see if they match with any of the content found in content.json.

Using your own Twitter account

  • Apply for a Twitter developer account here
  • This will give you access to your own API keys and access tokens.
  • Now, change the file called config.py inside the working directory and fill it in
API_key = "YOUR OWN API KEY"
API_secret_key = "YOUR OWN API SECRET KEY"
Access_token = "YOUR OWN ACCESS TOKEN"
Access_token_secret = "YOUR OWN SECRET ACCESS TOKEN"

Before running the code, make sure that

DEBUG = False

in twitter.py.

About

This application will be a learning experience in using the twitter API. The objective will be to create a bot that replies to users with media content that is related to the tweet that they posted. For example if the tweet has the phrase "It was a good day", it will reply with a Youtube link to the music video it was a good day by ice cube.


Languages

Language:Python 100.0%