Mushrooms, Beef Jerky, and Programming 5

Posted by Aaron Patterson on September 08, 2008

This weekend I went mushroom hunting and found about 6 Chanterelle mushrooms, and they were delicious! I made cream of mushroom soup with Chanterelles for the main course, and a Tres Leches cake for desert. I still have about three pound left. I think I'll go hunting them again next weekend. I can't wait! I'm thinking about giving a few to zenspider a few since I know how much he loves them.

IMG_0206.JPGIMG_0210.JPG

Recently, I've been refactoring Mechanize and I've added support for a few new things. First, mechanize now (and when I say "now", I mean whats checked in) supports "file://" urls. For example:

agent = WWW::Mechanize.new
page = agent.get("file:///Users/aaron/some_file.html")

Directories work too. Mechanize will turn directories in to a list of links for your navigation convenience. I've also added criteria based searching to links and frames. For example:

agent = WWW::Mechanize.new
agent.get('http://google.com/') do |page|
  page = page.form_with(:name => 'f') do |form|
    form.q = 'Aaron Patterson'
  end.submit

  page.links_with(:text => /tender/i).each do |link|
    puts link.text
  end
end

There is a singular and plural form. So you can locate many or one form, link, iframes, etc.

These changes will go in to an 0.8.0 release. However, I'm planning larger changes for a 1.0.0 release. I want to get rid of the WWW namespace, and stick with just Mechanize. I think that would probably be the largest change between 0.8.0 and 1.0.0 that I can think of. If you'd like to try out the new changes, just grab the gem from github: "gem install tenderlove-mechanize -s http://gems.github.com".

Finally, I will be teaching the Ruby Certificate course at the UW. There are 3 courses, beginning Ruby, Ruby with Rails, and Advanced Topics in Ruby. Ryan will be teaching the beginning course, I'll be teaching the Rails course, and I will be co-instructing the advanced course with Ryan. I am considering using The Rails Way or Agile Web Development with Rails (3rd ed). I'm leaning towards the Agile book, but we'll see! Anyway, you should sign up!

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

  1. Wes Maldonado Tue, 16 Sep 2008 18:32:15 PDT

    I’d go with Agile Web Development with Rails if I were teaching. I would use The Rails Way for sidebar content once the core concepts were understood.

  2. markus Tue, 21 Oct 2008 13:58:37 PDT

    cool

    didnt even know you had a blog :)

    added to my list of ruby-blogs i can visit :D

    mechanize rocks!

  3. markus Tue, 21 Oct 2008 14:05:39 PDT

    Oh btw i agree with this:

    “I want to get rid of the WWW namespace, and stick with just Mechanize”

    I just used mechanize for a local page, and the WWW felt a bit misplaced (i mean… with my http://localhost part i dont even need access to the http://www. only apache on localhost or even webrick. But granted it is a quite minor thing )

  4. Wally Glutton Tue, 04 Nov 2008 09:54:01 PST

    Hi,

    I’m currently using Agile Web Dev with Rails (3rd) as a textbook for a college level (http://rrc.mb.ca/) Ecommerce/Rails course. I highly recommend it. Each chapter of the Depot tutorial works nicely as an assignment (with my own additions so that the assignments aren’t trivial). I looked into using the Rails Way, but I find it’s best used as a reference as it assumes some familiarity with Rails.

    I made a quick outline of the required Ruby/Rails knowledge for each chapter of the Agile book:

    http://stungeye.infogami.com/RequireKnowledgeforAgileRails

    Hit me up with an email if you are interested in chatting about this further.

  5. Wally Glutton Tue, 04 Nov 2008 09:57:49 PST

    Markdown ate my link:

    http://stungeye.infogami.com/RequireKnowledgeforAgileRails

    I’m not sure if slash-escaping the underlines will work, if not feel free to remove this comment. :)

Comments

Check Spelling
Activate Spell Check while Typing