mirror of
https://github.com/thewesker/ebooks_example.git
synced 2025-12-20 04:11:13 -05:00
Merge pull request #2 from Hiramiya/master
Prevent double-favourite on special tweets
This commit is contained in:
3
bots.rb
3
bots.rb
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user