Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

twitterbot_retweet.py #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions twitterbot_retweet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import tweepy
import datetime
from time import sleep
from credentials import *
from config import QUERY, FOLLOW, LIKE, SLEEP_TIME
Expand All @@ -7,22 +8,22 @@
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)

print("Twitter bot which retweets,like tweets and follow users")
print("Bot Settings")
print("Like Tweets :", LIKE)
print("Follow users :", FOLLOW)
print("Twitter bot which retweets,like tweets and follow users") your text
print("Bot Settings") your text
print("Like Tweets :", LIKE) # your text
print("Follow users :", FOLLOW) # your text

for tweet in tweepy.Cursor(api.search, q=QUERY).items():
try:
print('\nTweet by: @' + tweet.user.screen_name)

tweet.retweet()
print('Retweeted the tweet')
print('Retweeted the tweet') your text

# Favorite the tweet
if LIKE:
tweet.favorite()
print('Favorited the tweet')
print('Favorited the tweet') your text

# Follow the user who tweeted
#check that bot is not already following the user
Expand All @@ -33,6 +34,12 @@

sleep(SLEEP_TIME)

# create def Bye():
def Bye():
print('Bye!') your text

Bye() Close

except tweepy.TweepError as e:
print(e.reason)

Expand Down