tweet.py
This file contains the implimentation of Tweepy - a Python wrapper for the Twitter API. The class Tweets in this file contains the method which - connects to the Twitter API, filters the tweets and returns the desired tweets.
config.py
This file contains the authorisation tokens (Access Token, Access Token Secret, Consumer Key, Consumer Secret), which is used in the class defined in tweet.py.
route.py
I have used the Flask - a micro web framework - to create the APIs. For the requests routed to /getTweets, the code returns the list of tweets.
To Run:
-
Define the authorisation tokens in config.py
-
Execute the route.py
python route.py
-
Test the Restful API defined ( default - http://127.0.0.1:5000/getTweets )