<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -13,6 +13,7 @@ Another option if you only want to follow your followers is
 running it off command line like auto_follow.rb admin@example.com password
 
 You can black list people from been added to your friend by adding them to the yaml file called black_list.yml.
+The script will also construct a black_list.yml once it finishes because it might add more names to the list.
 
 NB:
 Twitter has limit on how many people you can follow in an hour.</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -43,35 +43,13 @@ class AutoFollower
     peeps = (followers - friends).find_all { |n| !black_listed?(n) }
     
     @log.info &quot;Need to follow #{peeps.size} people&quot;
-    begin
-      peeps.each { |name| follow(name) }
-    ensure
-      save_black_list
-    end
+    execute { peeps.each { |name| follow(name) } }
   end
   
   def stalk(query, page = 1)
-    begin
-      _stalk(query, page)
-    ensure
-      save_black_list
-    end
-  end
-  
-  def save_black_list
-    File.open(BLACK_LIST, 'w') {|f| f.write(black_list.to_yaml) }
+    execute { _stalk(query, page) }
   end
   
-  def _stalk(query, page = 1)
-    @log.debug(&quot;Stalking page: #{page}&quot;)
-    doc = Hpricot(open(&quot;http://twitter.com/search/users?q=#{query}&amp;page=#{page}&quot;))
-    names = doc.search(&quot;.screen_name span&quot;).collect { |d| d.innerHTML }
-    return if names.empty?
-    (names - friends).find_all { |n| !black_listed?(n) }.each { |name| follow(name) }
-    page = page + 1
-    stalk(query, page)
-  end
-
   def followers
     @followers ||= find_followers
   end
@@ -82,10 +60,28 @@ class AutoFollower
 
   private
   
+    def execute(&amp;block)
+      begin
+        block.call
+      ensure
+        File.open(BLACK_LIST, 'w') {|f| f.write(black_list.to_yaml) }
+      end
+    end
+  
     def black_listed?(name)
       black_list.include?(name)
     end
   
+    def _stalk(query, page = 1)
+      @log.debug(&quot;Stalking page: #{page}&quot;)
+      doc = Hpricot(open(&quot;http://twitter.com/search/users?q=#{query}&amp;page=#{page}&quot;))
+      names = doc.search(&quot;.screen_name span&quot;).collect { |d| d.innerHTML }
+      return if names.empty?
+      (names - friends).find_all { |n| !black_listed?(n) }.each { |name| follow(name) }
+      page = page + 1
+      stalk(query, page)
+    end
+
     def follow(name, delay = FOLLOW_INTERVAL)
       begin
         @twitter.create_friendship(name)</diff>
      <filename>auto_follow.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6f4d8e32ee0f8e19d36a888f45b2b932991eb6d1</id>
    </parent>
  </parents>
  <author>
    <name>Andy Shen</name>
    <email>andy@shenie.info</email>
  </author>
  <url>http://github.com/shenie/auto_follow/commit/72422e43a4d7bd8c97da329c7d9ee171a8e06727</url>
  <id>72422e43a4d7bd8c97da329c7d9ee171a8e06727</id>
  <committed-date>2008-07-31T13:10:09-07:00</committed-date>
  <authored-date>2008-07-31T13:10:09-07:00</authored-date>
  <message>moved method around, used a execute with block to dry up saving of black list, updated readme about black list feature</message>
  <tree>ceef809f8b2d83ba55f8cee72783e7d46d27c0b2</tree>
  <committer>
    <name>Andy Shen</name>
    <email>andy@shenie.info</email>
  </committer>
</commit>
