-
-
Save flavorjones/96824 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/ruby | |
require 'rubygems' | |
require 'twitter' | |
require 'open-uri' | |
require 'nokogiri' | |
TARGET_USER = "aplusk" | |
TARGET_COUNT = 1_000_000 | |
URL = "http://twitter.com/#{TARGET_USER}" | |
ID = '#follower_count' | |
USERNAME = '' | |
PASS = '' | |
twitter = Twitter::Base.new(USERNAME,PASS) | |
count = 0 | |
response = '' | |
while count < TARGET_COUNT | |
open(URL){|f| response = f.read} | |
count = Nokogiri(response).search(ID).inner_html.gsub(',','').to_i | |
p "#{Time.now}: #{TARGET_USER} has #{count} followers" | |
if (count == TARGET_COUNT-1) | |
p "Holy crap! Follow him! Quick!" | |
twitter.create_friendship TARGET_USER | |
twitter.follow TARGET_USER | |
end | |
sleep(0.1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment