#!/usr/bin/python3 # -*- coding: utf-8 -*- import argparse import tweepy from auth import * from db import open_db from live import listen_live from tweepy import OAuthHandler from users import listen_to_users if __name__ == '__main__': """Start of the script.""" auth = OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) auth.set_access_token(ACCESS_KEY, ACCESS_SECRET) api = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True) open_db() parser = argparse.ArgumentParser() parser.add_argument('-p', '--purge', help='Delete old liked Tweets', action='store_true') parser.add_argument('-d', '--daily', help='Analyse contents from selected followers', action='store_true') args = parser.parse_args() if args.purge: memory.purge_old_status() elif args.daily: listen_to_users(auth, api) else: listen_live(auth, api)