- Timestamp:
- 07/03/08 11:08:39 (6 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/misc/twitter_remove_friends/twitter_remove_friends_json.rb
r15076 r15079 17 17 followers = [] 18 18 begin 19 doc = JSON.parse(open(TWITTER_API + "statuses/friends.json", :http_basic_authentication => [twitter_account[:username], twitter_account[:password]]).read)20 yaml = YAML.load(Pathname.new(ARGV[0] ).expand_path.read)19 page = 1 20 yaml = YAML.load(Pathname.new(ARGV[0] || "defaults.yaml").expand_path.read) 21 21 22 doc.each do |user| 23 duration = Time.now - Time.parse(user["status"]["created_at"]) 24 if duration > yaml["duration"].to_i * 24 * 60 * 60 25 followers << user["screen_name"] 22 loop do 23 json = JSON.parse(open(TWITTER_API + "statuses/friends.json?page=#{page}", :http_basic_authentication => [twitter_account[:username], twitter_account[:password]]).read) 24 break if json.empty? 25 26 json.each do |user| 27 duration = Time.now - Time.parse(user["status"]["created_at"]) 28 if duration > yaml["duration"].to_i * 24 * 60 * 60 29 followers << user["screen_name"] 30 end 26 31 end 32 33 page += 1 34 sleep(5) 27 35 end 28 36
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)