Merge pull request #2 from Hiramiya/master

Prevent double-favourite on special tweets
This commit is contained in:
Mispy
2014-05-18 00:44:27 +10:00

View File

@@ -67,6 +67,7 @@ class GenBot
if special if special
favorite(tweet) favorite(tweet)
favd = true # Mark this tweet as favorited
bot.delay DELAY do bot.delay DELAY do
bot.follow tweet[:user][:screen_name] bot.follow tweet[:user][:screen_name]
@@ -79,7 +80,7 @@ class GenBot
$have_talked[tweet[:user][:screen_name]] = true $have_talked[tweet[:user][:screen_name]] = true
if very_interesting || special if very_interesting || special
favorite(tweet) if rand < 0.5 favorite(tweet) if (rand < 0.5 && !favd) # Don't fav the tweet if we did earlier
retweet(tweet) if rand < 0.1 retweet(tweet) if rand < 0.1
reply(tweet, meta) if rand < 0.1 reply(tweet, meta) if rand < 0.1
elsif interesting elsif interesting