rhiever / TwitterFollowBot

A Python bot that automates several actions on Twitter, such as following users and favoriting tweets.
GNU General Public License v3.0
1.31k stars 447 forks source link

File #101

Closed Deio closed 8 years ago

Deio commented 8 years ago

I'm new to this. In what file do I put the instance of the Twitter bot in? And how do I make it run every x minutes? Do I just set it up on cron? And if that, what directory or file do I put in after the timer is set? Yeah sorry I know I sound like a huge noob in this but that's becaus I am . Thanks in advance :)

ghost commented 8 years ago

You create a new file with the instance in the new file and depending on your operating system, you run a cronjob to set it to whatever timing you want it to run.

Deio commented 8 years ago

Still not working. I made my cron job work every minute but it is not working. The file with the insatnce of the bot is called "bot" and is put in the TwitterFollowBot-master directory. Here's what I put in the cron job: 1 * * * * /Users/usermac1/Desktop/TwitterFollowBot-master/bot .

This is what is in the bot file: from TwitterFollowBot import TwitterBot

my_bot = TwitterBot() my_bot.sync_follows() my_bot.auto_follow("yay") my_bot.auto_follow_followers() my_bot.auto_fav("yay", count=1000) my_bot.auto_rt("yay", count=1000)

ghost commented 8 years ago

You need to make the file extention a .py file. so it should be called "bot.py". As for your cronjob use the one i put for you below.

1 * * * * python /Users/usermac1/Desktop/TwitterFollowBot-master/bot.py

Use the instance in your bot i have put below and it should work.

from TwitterFollowBot import TwitterBot

my_bot = TwitterBot("/Users/usermac1/Desktop/TwitterFollowBot-master/config.txt") my_bot.sync_follows() my_bot.auto_follow("yay") my_bot.auto_follow_followers() my_bot.auto_fav("yay", count=1000) my_bot.auto_rt("yay", count=1000)

Deio commented 8 years ago

Yeah thanks it worked