<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -58,18 +58,25 @@ Copy config.yml.sample to config.yml and fill it out with:
 
 then:
 
-ruby name-of-script.rb flickr-short-username limit-number-of-pictures purchase
+ruby name-of-script.rb flickr-user-email-address limit-number-of-pictures (purchase|preview)
+
+The email address is the email address used by the individual user at Flickr.
+
+The limit should be an integer.
 
 If you leave off &quot;purchase&quot;, the files will simply be uploaded to your web server and you'll be given URLs for them. If you add purchase, a moo.com order for stickers will be created, and you'll be given a URL to view that order.
 
 Alternatively, replacing &quot;purchase&quot; with &quot;preview&quot; will dump the XML for your order out to the command prompt. You can run this through the Moo validator (http://www.moo.com/api/validator.php) to check if things are all coming out OK.
 
+stickr uses SFTP. If you already have an SSH key set up on your server, you will be asked for that when the script authorizes against SFTP.
+
 Requirements
 ------------
 
 ImageMagick
 RMagick
 Hprciot
+Net::Flickr (http://code.google.com/p/net-flickr/ - sudo gem install net-flickr)
 HTMLEntities
 Net::SSH
 </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -9,15 +9,14 @@ require 'lib/flickr_image_processor'
 CONFIG = YAML.load_file(&quot;config.yml&quot;)
 
 if ARGV[0]
-  userstring = ARGV[0]
-
+  email = ARGV[0]
   if ARGV[1]
     limit = ARGV[1].to_i
   else
     limit = 90
   end
 
-  dadaist_processor = DadaistStickers.new(userstring, limit, CONFIG[&quot;flickr_api_key&quot;])
+  dadaist_processor = DadaistStickers.new(email, limit, CONFIG[&quot;flickr_api_key&quot;])
   
   processed_images = dadaist_processor.process_each_image
   public_image_urls = []</diff>
      <filename>dadaist-photos.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,27 +1,19 @@
 require 'rubygems'
 require 'RMagick'
 require 'open-uri'
-require 'hpricot'
+require 'net/flickr'
 include Magick
 
 class FlickrImageProcessor
-  def initialize(userstring, limit, api_key)
-    # TODO:
-    # next steps:
-    # get by user *name*
-    # get the first *78*
-    # get the *medium* filesize
-
-    user_photos_page = Hpricot(open(&quot;http://flickr.com/photos/#{userstring}&quot;))
-    atom_url = user_photos_page.search(&quot;head link[@type='application/atom+xml']&quot;).first[:href]
-
-    user_atom = Hpricot(open(atom_url))
-
-    pics = user_atom.search(&quot;entry&quot;).map {|pic| {:title =&gt; pic.search(&quot;title&quot;).inner_html, :url =&gt; pic.search(&quot;link[@rel='enclosure']&quot;).first[:href]}}
-    if limit
-      @pics = pics.slice(0,limit)
-    else
-      @pics = pics
+  def initialize(email, limit, api_key)
+    flickr = Net::Flickr.new(api_key)
+    @pics = []
+    
+    flickr.people.find_by_email(email).photos(&quot;per_page&quot; =&gt; limit).each do |photo|
+      title = photo.title
+      url = photo.source_url(:medium)
+      
+      @pics &lt;&lt; {:title =&gt; title, :url =&gt; url}
     end
   end
   
@@ -31,10 +23,6 @@ class FlickrImageProcessor
 end
 
 class StripyStickers &lt; FlickrImageProcessor
-  # def initialize(*args)
-  #   super
-  # end
-  
   def process_each_image
     @pics.map do |title_and_url|
       title = title_and_url[:title]</diff>
      <filename>lib/flickr_image_processor.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,14 +9,14 @@ require 'lib/flickr_image_processor'
 CONFIG = YAML.load_file(&quot;config.yml&quot;)
 
 if ARGV[0]
-  userstring = ARGV[0]
+  email = ARGV[0]
   if ARGV[1]
     limit = ARGV[1].to_i
   else
     limit = 90
   end
 
-  stripes_processor = StripyStickers.new(userstring, limit, CONFIG[&quot;flickr_api_key&quot;])
+  stripes_processor = StripyStickers.new(email, limit, CONFIG[&quot;flickr_api_key&quot;])
   
   processed_images = stripes_processor.process_each_image
   public_image_urls = []
@@ -65,5 +65,5 @@ if ARGV[0]
     public_image_urls.each {|url| puts url}
   end
 else
-  puts &quot;Usage: stripy-photos.rb flickr_user_string limit&quot;
+  puts &quot;Usage: stripy-photos.rb flickr_user_email limit (purchase|preview)&quot;
 end</diff>
      <filename>stripy-photos.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>14868ad57d6aeddacafc8837c66cb358ce231ecd</id>
    </parent>
  </parents>
  <author>
    <name>Tom Armitage</name>
    <email>tom@infovore.org</email>
  </author>
  <url>http://github.com/infovore/stickrs/commit/f6e7b0af1667934317ca150b66089f55e13abeae</url>
  <id>f6e7b0af1667934317ca150b66089f55e13abeae</id>
  <committed-date>2008-09-27T15:31:03-07:00</committed-date>
  <authored-date>2008-09-27T15:31:03-07:00</authored-date>
  <message>Moving to net/flickr.</message>
  <tree>1e3c05731b94371bb27e13edcd4bd95ca4bd5c7a</tree>
  <committer>
    <name>Tom Armitage</name>
    <email>tom@infovore.org</email>
  </committer>
</commit>
