<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tender Lovemaking &#187; mechanize</title>
	<atom:link href="http://tenderlovemaking.com/category/mechanize/feed/" rel="self" type="application/rss+xml" />
	<link>http://tenderlovemaking.com</link>
	<description>The act of making love, tenderly.</description>
	<lastBuildDate>Sat, 26 Jun 2010 02:57:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Automated Youtube Uploads</title>
		<link>http://tenderlovemaking.com/2008/02/26/automated-youtube-uploads/</link>
		<comments>http://tenderlovemaking.com/2008/02/26/automated-youtube-uploads/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 17:38:02 +0000</pubDate>
		<dc:creator>Aaron Patterson</dc:creator>
				<category><![CDATA[computadora]]></category>
		<category><![CDATA[mechanize]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://tenderlovemaking.com/2008/02/26/automated-youtube-uploads/</guid>
		<description><![CDATA[I thought I would share the part of my twitterbrite scripts that uploads videos to Youtube. Its about 30 lines long, and took me an hour or so to write. Most of my time was spent figuring out form fields to fill out rather than writing code though&#8230;. I&#8217;ve broken the script down to three [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I would share the part of my <a href="http://twitterbrite.com/">twitterbrite</a> scripts that uploads videos to <a href="http://youtube.com/">Youtube</a>.  Its about 30 lines long, and took me an hour or so to write.  Most of my time was spent figuring out form fields to fill out rather than writing code though&#8230;.</p>
<p>I&#8217;ve broken the script down to three parts: logging in, setting the video attributes, and uploading the video file.</p>
<h3>Step 1: Logging In</h3>
<p>The first step is pretty simple.  Just instantiate a new mechanize object, fetch youtube.com, set your login credentials, and submit!</p>
<pre class="brush: ruby;">
agent = WWW::Mechanize.new { |a|
  a.user_agent_alias = 'Mac Safari'
}
page = agent.get('http://youtube.com/')

# Login
page.form('loginForm') { |f|
  f.username = 'username'
  f.password = 'password'
}.submit
</pre>
<h3>Step 2: Setting video attributes</h3>
<p>This is probably the most difficult step.  Now that the agent is logged in, we have to fetch the upload page and fill out the video attributes form.  You have to set the title, description, category, and keywords for your video.  The you have to tell the agent to click a special button.</p>
<pre class="brush: ruby;">
# Set the video attributes
page = agent.get('http://youtube.com/my_videos_upload')
form = page.form('theForm')
form.field_myvideo_title = 'My video title'
form.field_myvideo_descr = &quot;My video description&quot;
form.field_myvideo_categories = 28
form.field_myvideo_keywords = 'my tag'
page = form.submit(form.buttons.name('action_upload').first)
</pre>
<p>The number &#8220;28&#8243; is just the value from the category drop down list.  You can iterate over the select options using mechanize, but I leave that as an exercise to the reader.</p>
<h3>Step 3: Upload the video file</h3>
<p>My script expects that the video file name will be supplied on the command line, so ARGV[0] should point to the file you want to upload.  In this step, you simply set the video file name, then submit the form.</p>
<pre class="brush: ruby;">
# Upload the video
page = page.form('theForm') { |f|
  f.file_uploads.name('field_uploadfile').first.file_name = ARGV[0]
}.submit
page.body =~ /&lt;textarea[^&gt;]*&gt;(.*)&lt;\/textarea&gt;/m
puts $1
</pre>
<p>The last two lines grab the html needed to display the video and prints it.</p>
<p>There you go.  Upload lots of videos now!  Yay!</p>
]]></content:encoded>
			<wfw:commentRss>http://tenderlovemaking.com/2008/02/26/automated-youtube-uploads/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Watch Your Twits</title>
		<link>http://tenderlovemaking.com/2008/02/26/watch-your-twits/</link>
		<comments>http://tenderlovemaking.com/2008/02/26/watch-your-twits/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 07:12:39 +0000</pubDate>
		<dc:creator>Aaron Patterson</dc:creator>
				<category><![CDATA[betabrite]]></category>
		<category><![CDATA[computadora]]></category>
		<category><![CDATA[mechanize]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://tenderlovemaking.com/2008/02/26/watch-your-twits/</guid>
		<description><![CDATA[If this doesn&#8217;t win me the super nerd of the year award, I don&#8217;t know what will. In fact, this is so nerdy that I&#8217;m kind of ashamed to write about it! Remeber my Twitterbrite post? Well I registered twitterbrite.com, and now if my client catches a twit from you, it records the message on [...]]]></description>
			<content:encoded><![CDATA[<p>If this doesn&#8217;t win me the super nerd of the year award, I don&#8217;t know what will.  In fact, this is so nerdy that I&#8217;m kind of ashamed to write about it!</p>
<p>Remeber my <a href="http://tenderlovemaking.com/2008/02/22/twitterbrite/">Twitterbrite</a> post?  Well I registered <a href="http://twitterbrite.com/">twitterbrite.com</a>, and now if my client catches a twit from you, it records the message on the LED sign and uploads it to <a href="http://youtube.com/profile_videos?user=aaronp58">my youtube account</a>.  Go ahead, check out <a href="http://twitterbrite.com/">twitterbrite.com</a> now!</p>
<p><strong>Update:</strong> My scripts are too chatty, so now it will only post videos if the text of the twit contains &#8216;betabrite&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://tenderlovemaking.com/2008/02/26/watch-your-twits/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Happy New Year! (RKelly Progress report)</title>
		<link>http://tenderlovemaking.com/2008/01/03/happy-new-year-rkelly-progress-report/</link>
		<comments>http://tenderlovemaking.com/2008/01/03/happy-new-year-rkelly-progress-report/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 18:31:52 +0000</pubDate>
		<dc:creator>Aaron Patterson</dc:creator>
				<category><![CDATA[computadora]]></category>
		<category><![CDATA[ecma]]></category>
		<category><![CDATA[mechanize]]></category>
		<category><![CDATA[rkelly]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://tenderlovemaking.com/2008/01/03/happy-new-year-rkelly-progress-report/</guid>
		<description><![CDATA[I&#8217;ve just started getting the runtime working with RKelly. Its working well enough at this point that I was able to execute my earlier Fibonacci example. I&#8217;ve added a method to the runtime that allows you to define ruby functions that may be called from inside javascript. For example, the alert function in the following [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just started getting the runtime working with RKelly.  Its working well enough at this point that I was able to execute my earlier Fibonacci example.  I&#8217;ve added a method to the runtime that allows you to define ruby functions that may be called from inside javascript.  For example, the alert function in the following example is defined in ruby and delegates to puts.</p>
<pre class="brush: ruby;">
runtime = RKelly::Runtime.new

runtime.define_function(:alert) do |*args|
  puts(*args)
end

runtime.execute(&lt;&lt;END
function f(n) {
  var s = 0;
  if(n == 0) return(s);
  if(n == 1) {
    s += 1;
    return(s);
  } else {
    return(f(n - 1) + f(n - 2));
  }
}
alert(f(20));
END
)
</pre>
<p>Here is the execution time with ruby 1.8.6 on my machine:<br />
<code><br />
[aaron@mac-mini rkelly]$ time ~/.multiruby/install/1.8.6-p111/bin/ruby -I lib test.rb<br />
6765</p>
<p>real	0m54.332s<br />
user	0m53.913s<br />
sys	0m0.336s<br />
[aaron@mac-mini rkelly]$<br />
[/sourcecode]</p>
<p>Same code, same machine, but with ruby 1.9.0:</p>
<p><code><br />
[aaron@mac-mini rkelly]$ time ~/.multiruby/install/1.9.0-0/bin/ruby -I lib test.rb<br />
6765</p>
<p>real	0m20.863s<br />
user	0m20.678s<br />
sys	0m0.142s<br />
[aaron@mac-mini rkelly]$<br />
[/sourcecode]</p>
<p>I need to get loops working next!</p>
]]></content:encoded>
			<wfw:commentRss>http://tenderlovemaking.com/2008/01/03/happy-new-year-rkelly-progress-report/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Road to Mechanize 0.7.0</title>
		<link>http://tenderlovemaking.com/2007/12/09/road-to-mechanize-070/</link>
		<comments>http://tenderlovemaking.com/2007/12/09/road-to-mechanize-070/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 05:56:59 +0000</pubDate>
		<dc:creator>Aaron Patterson</dc:creator>
				<category><![CDATA[computadora]]></category>
		<category><![CDATA[mechanize]]></category>

		<guid isPermaLink="false">http://tenderlovemaking.com/2007/12/09/road-to-mechanize-070/</guid>
		<description><![CDATA[I&#8217;ve been refactoring Mechanize for an 0.7.0 release. Basically I&#8217;m trying to clean the code up and there are a few features that I think are unnecessary, but I would like to ask people first. REXML as a parser. I want to remove support for REXML. I don&#8217;t use it. Hpricot seems to do everything [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been refactoring Mechanize for an 0.7.0 release.  Basically I&#8217;m trying to clean the code up and there are a few features that I think are unnecessary, but I would like to ask people first.</p>
<ol>
<li>REXML as a parser.</li>
<p>I want to remove support for REXML.  I don&#8217;t use it.  Hpricot seems to do everything I need.</p>
<li>1.8.2 thru 1.8.4 support</li>
<p>I&#8217;ve got a bunch of monkey patches for 1.8.2 thru 1.8.4.  I&#8217;d like to remove these because I think most people are on 1.8.5 or up.</p>
<li>WWW::Mechanize::Page#watch_for_set</li>
<p>I am going to remove this method.  It made sense when REXML was the main parser, since REXML was so slow.  I think that Hpricot is fast enough that this method is not so useful.
</ol>
<p>I&#8217;m going to make 0.7.0 lazily build up form and link objects, which should give everyone a slight speed increase but makes watch_for_set obsolete (sort of).</p>
<p>I&#8217;m changing around the class names to be better organized, but they should all have the same methods.  Also, if there are any feature requests, let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://tenderlovemaking.com/2007/12/09/road-to-mechanize-070/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>mechanize version 0.6.5 has been released!</title>
		<link>http://tenderlovemaking.com/2007/03/15/mechanize-version-065-has-been-released/</link>
		<comments>http://tenderlovemaking.com/2007/03/15/mechanize-version-065-has-been-released/#comments</comments>
		<pubDate>Fri, 16 Mar 2007 01:11:57 +0000</pubDate>
		<dc:creator>Aaron Patterson</dc:creator>
				<category><![CDATA[mechanize]]></category>

		<guid isPermaLink="false">http://tenderlovemaking.com/2007/03/15/mechanize-version-065-has-been-released/</guid>
		<description><![CDATA[The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, can follow links, and submit forms. Form fields can be populated and submitted. Mechanize also keeps track of the sites that you have visited as a history. Changes: = Mechanize CHANGELOG == 0.6.5 * Copying headers to [...]]]></description>
			<content:encoded><![CDATA[<p>The Mechanize library is used for automating interaction with websites.<br />
Mechanize automatically stores and sends cookies, follows redirects,<br />
can follow links, and submit forms.  Form fields can be populated and<br />
submitted.  Mechanize also keeps track of the sites that you have visited as<br />
a history.</p>
<p>Changes:</p>
<p>= Mechanize CHANGELOG</p>
<p>== 0.6.5</p>
<p>* Copying headers to a hash to prevent memory leaks<br />
* Speeding up page parsing<br />
* Aliased fields to elements<br />
* Adding If-Modified-Since header<br />
* Added delete_field! to form.  Thanks to Sava Chankov<br />
* Updated uri escaping to support high order characters.  Thanks to Henrik Nyh.<br />
* Better handling relative URIs.  Thanks to Henrik Nyh<br />
* Now handles pipes in URLs</p>
<p>http://rubyforge.org/tracker/?func=detail&#038;aid=7140&#038;group_id=1453&#038;atid=5709</p>
<p>* Now escaping html entities in form fields.</p>
<p>http://rubyforge.org/tracker/?func=detail&#038;aid=7563&#038;group_id=1453&#038;atid=5709</p>
<p>* Added MSIE 7.0 user agent string</p>
]]></content:encoded>
			<wfw:commentRss>http://tenderlovemaking.com/2007/03/15/mechanize-version-065-has-been-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ruby mechanize 0.6.5 Released</title>
		<link>http://tenderlovemaking.com/2007/02/26/ruby-mechanize-065-released/</link>
		<comments>http://tenderlovemaking.com/2007/02/26/ruby-mechanize-065-released/#comments</comments>
		<pubDate>Tue, 27 Feb 2007 02:48:38 +0000</pubDate>
		<dc:creator>Aaron Patterson</dc:creator>
				<category><![CDATA[computadora]]></category>
		<category><![CDATA[mechanize]]></category>

		<guid isPermaLink="false">http://tenderlovemaking.com/2007/02/26/ruby-mechanize-065-released/</guid>
		<description><![CDATA[mechanize version 0.6.5 has been released! http://mechanize.rubyforge.org/ The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, can follow links, and submit forms. Form fields can be populated and submitted. Mechanize also keeps track of the sites that you have visited as a history. Changes: = Mechanize [...]]]></description>
			<content:encoded><![CDATA[<p>mechanize version 0.6.5 has been released!</p>
<p>  <a href="http://mechanize.rubyforge.org">http://mechanize.rubyforge.org/</a></p>
<p>The Mechanize library is used for automating interaction with websites.<br />
Mechanize automatically stores and sends cookies, follows redirects,<br />
can follow links, and submit forms.  Form fields can be populated and<br />
submitted.  Mechanize also keeps track of the sites that you have visited as<br />
a history.</p>
<p>Changes:</p>
<p>= Mechanize CHANGELOG</p>
<p>== 0.6.5</p>
<p>* Copying headers to a hash to prevent memory leaks<br />
* Speeding up page parsing<br />
* Aliased fields to elements<br />
* Adding If-Modified-Since header<br />
* Added delete_field! to form.  Thanks to Sava Chankov<br />
* Updated uri escaping to support high order characters.  Thanks to Henrik Nyh.<br />
* Better handling relative URIs.  Thanks to Henrik Nyh<br />
* Now handles pipes in URLs</p>
<p>http://rubyforge.org/tracker/?func=detail&#038;aid=7140&#038;group_id=1453&#038;atid=5709</p>
<p>* Now escaping html entities in form fields.</p>
<p>http://rubyforge.org/tracker/?func=detail&#038;aid=7563&#038;group_id=1453&#038;atid=5709</p>
<p>* Added MSIE 7.0 user agent string</p>
<p>  <a href="http://mechanize.rubyforge.org">http://mechanize.rubyforge.org/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tenderlovemaking.com/2007/02/26/ruby-mechanize-065-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Graphing Objects in Memory with Ruby</title>
		<link>http://tenderlovemaking.com/2007/01/13/graphing-objects-in-memory-with-ruby/</link>
		<comments>http://tenderlovemaking.com/2007/01/13/graphing-objects-in-memory-with-ruby/#comments</comments>
		<pubDate>Sun, 14 Jan 2007 04:01:12 +0000</pubDate>
		<dc:creator>Aaron Patterson</dc:creator>
				<category><![CDATA[computadora]]></category>
		<category><![CDATA[mechanize]]></category>

		<guid isPermaLink="false">http://tenderlovemaking.com/2007/01/13/graphing-objects-in-memory-with-ruby/</guid>
		<description><![CDATA[I was debugging Mechanize the other day, and thought it would be handy to have a graph of objects in memory and they&#8217;re relationship with each other. So I put together a simple script that outputs a Graphviz file illustrating what the object points to. Here&#8217;s the code: require 'ograph' require 'rubygems' require 'mechanize' mech [...]]]></description>
			<content:encoded><![CDATA[<p>I was debugging <a href="http://mechanize.rubyforge.org/">Mechanize</a> the other day, and thought it would be handy to have a graph of objects in memory and they&#8217;re relationship with each other.  So I put together a simple script that outputs a <a href="http://www.graphviz.org/">Graphviz</a> file illustrating what the object points to.  Here&#8217;s the code:</p>
<pre class="brush: ruby;">
require 'ograph'
require 'rubygems'
require 'mechanize'

mech = WWW::Mechanize.new
mech.get('http://google.com/')

puts ObjectGraph.graph(mech, /^WWW/)
</pre>
<p>and the output:</p>
<p><a href="http://www.flickr.com/photos/aaronp/356483048/" title="Photo Sharing"><img src="http://farm1.static.flickr.com/134/356483048_8eeba743ea.jpg" width="236" height="500" alt="Mechanize Memory Graph for Google" /></a></p>
<p>Right now it only supports Arrays, but should be easily extensible to support all other Enumerable types.  Here&#8217;s the code for ObjectGraph:</p>
<pre class="brush: ruby;">
class ObjectGraph
  def self.graph(target, class_name = /./)
    stack         = [target]
    object_links  = []
    seen_objects  = []
    seen_hash     = {}

    while stack.length &gt; 0
      object = stack.pop
      next if seen_hash.key? object.object_id
      seen_hash[object.object_id] = 1

      if object.is_a?(Enumerable) &amp;&amp; ! object.is_a?(String)
        object.each { |iv|
          if iv.class.to_s =~ class_name || object.is_a?(Enumerable)
            object_links.push([object.object_id, iv.object_id])
            stack.push(iv)
          end
        }
      else
        object.instance_variables.each do |iv_sym|
          iv = object.instance_variable_get iv_sym
          if iv.class.to_s =~ class_name || iv.is_a?(Enumerable)
            object_links.push([object.object_id, iv.object_id])
            stack.push(iv)
          end
        end
      end
      seen_objects.push([object.object_id, object.class])
    end

    s = &lt;&lt;END
digraph g {
    graph [ rankdir = &quot;LR&quot; ];
    node [ fontsize = &quot;8&quot;
           shape = &quot;ellipse&quot;
    ];
    edge [ ];
END
    seen_objects.each { |id, klass|
      s += &lt;&lt;END
      &quot;#{id}&quot; [
      label = &quot;&lt;f0&gt; #{id}|#{klass}&quot;
      shape = &quot;record&quot;
      ]
END
    }
    object_links.each_with_index { |(from, to), i|
      s += &quot;\&quot;#{from}\&quot;:f0 -&gt; \&quot;#{to}\&quot;:f0 [ id = #{i} ]\n&quot;
    }
    s += &quot;}\n&quot;
    s
  end
end
</pre>
<p><strong>Update:</strong> added Enumerable support, so Hashes are now graphed.</p>
]]></content:encoded>
			<wfw:commentRss>http://tenderlovemaking.com/2007/01/13/graphing-objects-in-memory-with-ruby/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Ruby WWW::Mechanize 0.6.1 (Chuck)</title>
		<link>http://tenderlovemaking.com/2006/09/23/ruby-wwwmechanize-061-chuck/</link>
		<comments>http://tenderlovemaking.com/2006/09/23/ruby-wwwmechanize-061-chuck/#comments</comments>
		<pubDate>Sun, 24 Sep 2006 02:10:22 +0000</pubDate>
		<dc:creator>Aaron Patterson</dc:creator>
				<category><![CDATA[computadora]]></category>
		<category><![CDATA[mechanize]]></category>

		<guid isPermaLink="false">http://tenderlovemaking.com/2006/09/23/ruby-wwwmechanize-061-chuck/</guid>
		<description><![CDATA[I thought that while I was traveling in Europe I would be able to work on WWW::Mechanize, but then I found out that I can&#8217;t do anything when I&#8217;m travling. Traveling is too much work for me to do anything productive. Luckily I took a day off after my travels, and I was able to [...]]]></description>
			<content:encoded><![CDATA[<p>I thought that while I was traveling in Europe I would be able to work on <a href="http://mechanize.rubyforge.org/">WWW::Mechanize</a>, but then I found out that I can&#8217;t do anything when I&#8217;m travling.  Traveling is too much work for me to do anything productive.  Luckily I took a day off after my travels, and I was able to complete my work on Mechanize only a couple days late.  I think Mechanize is getting more popular, judging from the number of bug submitted.  I&#8217;ve fixed more bugs this release than any other.  Check out the <a href="http://mechanize.rubyforge.org/files/CHANGELOG.html">CHANGELOG</a> for more details on the bug fixes.</p>
<p>As far as new features are concerned, I&#8217;ve added a submit method to forms.  Before, you had to call submit on the mechanize object and pass in the form like this:</p>
<pre class="brush: ruby;">
page = agent.submit form
</pre>
<p>Now you can just call the submit method on the form like this:</p>
<pre class="brush: ruby;">
page = form.submit
</pre>
<p>Along the same line, I&#8217;ve added a click method to links.  Instead of passing a link to the agent object, you can just call the click method on the link like so:</p>
<pre class="brush: ruby;">
page = link.click
</pre>
<p>I wonder when people will figure out where the release names come from.  Nobody has said anything about them to me&#8230;..  So far I have:</p>
<ul>
<li>Twan</li>
<li>Sylvester</li>
<li>Rufus</li>
<li>Chuck</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tenderlovemaking.com/2006/09/23/ruby-wwwmechanize-061-chuck/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Road to Ruby Mechanize 0.6.0</title>
		<link>http://tenderlovemaking.com/2006/09/04/road-to-ruby-mechanize-060/</link>
		<comments>http://tenderlovemaking.com/2006/09/04/road-to-ruby-mechanize-060/#comments</comments>
		<pubDate>Mon, 04 Sep 2006 21:48:29 +0000</pubDate>
		<dc:creator>Aaron Patterson</dc:creator>
				<category><![CDATA[computadora]]></category>
		<category><![CDATA[mechanize]]></category>

		<guid isPermaLink="false">http://tenderlovemaking.com/2006/09/04/road-to-ruby-mechanize-060/</guid>
		<description><![CDATA[I&#8217;ve been working pretty hard on merging Mechanize with Hpricot in to what I call Mechpricot, or Hprichanize. Things are going quite well. I&#8217;ve totally cleaned up the Cookie code to use more cookie code from WEBrick, and in the process I found a bug in the way that WEBrick parses set-cookie headers. Unfortunately no [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working pretty hard on merging <a href="http://mechanize.rubyforge.org/">Mechanize</a> with <a href="http://code.whytheluckystiff.net/hpricot/">Hpricot</a> in to what I call Mechpricot, or Hprichanize.  Things are going quite well.  </p>
<p>I&#8217;ve totally cleaned up the Cookie code to use more cookie code from WEBrick, and in the process I <a href="http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/393608996fbc47b2/e0c69d007503bfd7">found a bug</a> in the way that WEBrick parses set-cookie headers.  Unfortunately no one has replied to my patch on ruby-talk, so I think I&#8217;ll try ruby-core next&#8230;..</p>
<p>I removed the dependency on mime-types in favor of using code in WEBrick.  I&#8217;d like to have as few dependencies as possible.  I would like to make a few more performance tweaks before I release.  I&#8217;ll see if I can get this completely done before this weekend.  Otherwise everyone will have to wait until I&#8217;m back from Spain!</p>
]]></content:encoded>
			<wfw:commentRss>http://tenderlovemaking.com/2006/09/04/road-to-ruby-mechanize-060/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mechanize + KEXP = New Music</title>
		<link>http://tenderlovemaking.com/2006/08/10/mechanize-kexp-new-music/</link>
		<comments>http://tenderlovemaking.com/2006/08/10/mechanize-kexp-new-music/#comments</comments>
		<pubDate>Thu, 10 Aug 2006 20:12:27 +0000</pubDate>
		<dc:creator>Aaron Patterson</dc:creator>
				<category><![CDATA[computadora]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[mechanize]]></category>

		<guid isPermaLink="false">http://tenderlovemaking.com/2006/08/10/mechanize-kexp-new-music/</guid>
		<description><![CDATA[I was able to write a pretty quick mechanize script that grabbed the playlist from kexp and put it in a SQLite database. From that, I came up with the top 4 songs played on KEXP for July: Tv On The Radio &#8211; Playhouses Midlake &#8211; Roscoe Johnny Cash &#8211; Gods Gonna Cut You Down [...]]]></description>
			<content:encoded><![CDATA[<p>I was able to write a pretty quick mechanize script that grabbed the playlist from <a href="http://kexp.org/">kexp</a> and put it in a <a href="http://www.sqlite.org/">SQLite</a> database.  From that, I came up with the top 4 songs played on KEXP for July:</p>
<ol>
<li>Tv On The Radio &#8211; Playhouses</li>
<li>Midlake &#8211; Roscoe</li>
<li>Johnny Cash &#8211; Gods Gonna Cut You Down</li>
<li>Silversun Pickups &#8211; Lazy Eye</li>
</ol>
<p>I also used <a href="http://nubyonrails.com/pages/gruff">Gruff Graphs</a> to make a graph:</p>
<p><a href="http://www.flickr.com/photos/aaronp/211974650/" title="Photo Sharing"><img src="http://static.flickr.com/96/211974650_01a31fcd89_m.jpg" width="240" height="180" alt="Popular KEXP Songs for July" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://tenderlovemaking.com/2006/08/10/mechanize-kexp-new-music/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
