Frames

How to make Twitter Auto Favorite bot?

0
1
1#!/usr/bin/env python

2import tweepy
3#from our keys module (keys.py), import the keys dictionary
4from keys import keys
5
6CONSUMER_KEY = keys['consumer_key']
7CONSUMER_SECRET = keys['consumer_secret']
8ACCESS_TOKEN = keys['access_token']
9ACCESS_TOKEN_SECRET = keys['access_token_secret']
10
11auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
12auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
13api = tweepy.API(auth)
14
15twt = api.search("#Salvatore",result_type="mixed",count=5)
16
17for s in twt:
18 api.create_favorite(s.id)
19 print(s.id)
20print("Done!!!")
21
Use your Twitter Key and Token values here