lib/twitter_ebooks/bot.rb
# Make an informed guess as to whether a user is a bot based
# on their behavior in this conversation
Make an informed guess as to whether a user is a bot based
on their behavior in this conversation
Make an informed guess as to whether a user is a bot based on their behavior in this conversation
def is_bot?(username)
      usertweets = @tweets.select { |t| t.user.screen_name.downcase == username.downcase }
      if usertweets.length > 2
        if (usertweets[-1].created_at - usertweets[-3].created_at) < 10
          return true
        end
      end
      username.include?("ebooks")
    end
def is_bot? ( username ) usertweets = @tweets . select { | t | t . user . screen_name . downcase == username . downcase } if usertweets . length > 2 if ( usertweets [ - 1 ] . created_at - usertweets [ - 3 ] . created_at ) < 10 return true end end username . include? ( "ebooks" ) end
Make an informed guess as to whether a user is a bot based
on their behavior in this conversation
Make an informed guess as to whether a user is a bot based on their behavior in this conversation
username