Show
Ignore:
Timestamp:
07/04/08 06:29:36 (5 months ago)
Author:
hsbt
Message:

small fix.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/misc/twitter_remove_friends/twitter_remove_friends_json.rb

    r15079 r15139  
    2626                json.each do |user| 
    2727                        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 
     28                        followers << user["screen_name"] if duration > yaml["duration"].to_i * 24 * 60 * 60 
    3129                end 
    3230                 
     
    3836         
    3937        followers.each do |name|  
    40                 unless yaml["ignore"].include?(name) 
    41                         open(TWITTER_API + "friendships/destroy/#{name}.xml", :http_basic_authentication => [twitter_account[:username], twitter_account[:password]]) 
    42                         puts "#{name} is removed" 
    43                         sleep(10) 
    44                 else 
    45                         puts "#{name}" 
    46                 end 
     38                next if yaml["ignore"].include?(name) 
     39                open(TWITTER_API + "friendships/destroy/#{name}.xml", :http_basic_authentication => [twitter_account[:username], twitter_account[:password]]) 
     40                puts "#{name} is removed" 
     41                sleep(10) 
    4742        end 
    4843rescue => e