2006-09-04 @ 14:48

Road to Ruby Mechanize 0.6.0

I’ve been working pretty hard on merging Mechanize with Hpricot in to what I call Mechpricot, or Hprichanize. Things are going quite well.

I’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 one has replied to my patch on ruby-talk, so I think I’ll try ruby-core next…..

I removed the dependency on mime-types in favor of using code in WEBrick. I’d like to have as few dependencies as possible. I would like to make a few more performance tweaks before I release. I’ll see if I can get this completely done before this weekend. Otherwise everyone will have to wait until I’m back from Spain!

read more »

2006-09-11 @ 17:39

My NPR is so Loud, they Hatin'

I’m up outta here tomorrow for Spain, and I realized that I’ll be missing out on my This American Life shows, so I am revisiting time-shifting my radio. I’ve got a D-Link USB Radio plugged in to my linux machine. I just had to install Alsa, lame, and fmtools and come up with a script to marry them. Here’s what I came up with:

#!/usr/bin/ruby -w

raise "#{$0} <name> <freq> <seconds>" if ARGV.length < 3

show    = ARGV[0]
freq    = ARGV[1]
seconds = ARGV[2]

FM      = '/usr/local/bin/fm'
LAME    = '/usr/bin/lame'
AMIXER  = '/usr/bin/amixer'
ARECORD = '/usr/bin/arecord'

file    = "#{ENV['HOME']}/#{show}_#{Time.now.strftime('%Y-%m-%d')}"
# Tune the radio
%x{#{FM} #{freq} 65535}

# Set up the mixer settings
%x{#{AMIXER} -c 0 set Line,0 100%,100% unmute cap}
%x{#{AMIXER} sset Capture 75%,75% unmute cap}
%x{#{ARECORD} -f cd -t wav -d #{seconds} #{file}.wav}
%x{#{LAME} --quiet -m j --preset standard #{file}.wav #{file}.mp3}
%x{rm #{file}.wav}

Then just set up my crontab to record the show: 0 19 * * Fri /home/aaron/record.rb TAL 94.9 3600 ~~~ Now I'll have This American Life waiting for me when I get home!

read more »

2006-09-22 @ 11:05

I'm Back

Hey everyone, I’m back. After 24 hours of traveling, I’m back in Seattle. I arrived Wednesday night, only to find the clutch in my car not working! Luckily my parents are in town, so they gave me a ride. I’m uploading photos, so watch my flickr page to see some neat stuff.

read more »

2006-09-23 @ 20:09

Congratulations to Angie and Joey

I don’t think I mentioned why I went to Spain….. Two old friends of mine got hitched. Highlights include me: I'll tell you something about JoeyIMG_0081.JPG

and them:


Happy wedding guys! I’m sure your kids will be like seven feet tall.

read more »

2006-09-23 @ 19:10

Ruby WWW::Mechanize 0.6.1 (Chuck)

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’t do anything when I’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’ve fixed more bugs this release than any other. Check out the CHANGELOG for more details on the bug fixes.

As far as new features are concerned, I’ve added a submit method to forms. Before, you had to call submit on the mechanize object and pass in the form like this:

page = agent.submit form

Now you can just call the submit method on the form like this:

page = form.submit

Along the same line, I’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:

page = link.click

I wonder when people will figure out where the release names come from. Nobody has said anything about them to me….. So far I have:

  • Twan
  • Sylvester
  • Rufus
  • Chuck
read more »

2006-09-28 @ 22:33

New Ruby BetaBrite - 0.0.2

I just released a new version of the ruby BetaBrite sign library. It lets you control BetaBrite signs. You can write text, change the color, fonts, display images, and do a bunch of other stuff.

In celebration of this new release, I created a DRb server that lets you write to my BetaBrite sign and take a photo of it! Here is the code that will write “Seattle.rb” to my server and take a photo:

require 'drb'
require 'rubygems'
require 'betabrite'

obj = DRbObject.new(nil, 'druby://eviladmins.org:9000')

File.open("out.jpg", 'wb') { |a|
  a.write obj.write_simple("Seattle.rb")

Which took this photo:

read more »