Make sure you have python 2.7 or 3.5 installed
Install tweepy
and flask
Set the following enviroment variables from your tweeter dev accont:
TW_CONSUMERKEY
, TW_SECRETKEY
, TW_ACCESS_TOKENKEY
, TW_TOKENSECRET
from the command line run:
python api.py
There are two main functionality of the bot:
- Search tweets for a specific link and reply to it with a specific text
- Give the list of all tweets of a specific hashtag given
url: /respond-to-links
parameters:
article_links: links to search for (multiple can be given)
response: the text to respond with
example: goto localhost:5000/respond-to-links?article_links=fakenews.example.com&article_links=fakenews.example.org&response="Your link is a fake news site!"
url: /hashtag-tweets
parameters:
hashtags: list of hashtags to search for (multiple can be given)
example: goto localhost:5000/hashtag-tweets?hashtags=fakenews&hashtags=fake_news