Friday, 29 July 2011

Problems running Firefox 5 from watir-webdriver on Mac OS 10.5

Finally decided it was time to update my watir-webdriver development environment to the latest version of Firefox. I have been happily using Firefox 3.6.19 on my 64bit Intel Mac 10.5 and yesterday made the jump to Firefox 5.

To my horror there is a bug in Firefox 4 and 5 which causes problems when attempting to start Firefox from the command line (basically what watir-webdriver does).

Thankfully with the help of Jarib Bakken I was able to use the workaround detailed on this blog post.

The work around is to strip the x86_64 part from firefox-bin using ditto:

cd /Applications/Firefox.app/Contents/MacOS
mv firefox-bin firefox-bin.original
ditto --arch i386 firefox-bin.original firefox-bin 

This will solve the problem until we can upgrade to a later version of Mac Os.

Doodle's Geek Monkey by Alastair Montgomery

Thursday, 21 July 2011

Ruby and RSS

Started looking into access RSS from Ruby discovered it pretty much already built in as described in this article Consuming RSS Feeds with Ruby, full docs are available in the Ruby Standard Library.

Accessing an RSS Feed is as simple as the following code snippet.

require "rss"
rss_feed = "http://meekgonkey.blogspot.com/feeds/posts/default?alt=rss"
rss_content = ""
open(rss_feed) { |f|
rss_content = f.read
}
puts "Bytes read #{rss_content.length} from feed"
rss = RSS::Parser.parse(rss_content,false)
puts "Title: #{rss.channel.title}"
puts "RSS URL: #{rss.channel.link}"
puts "Total entries: #{rss.items.size}"
rss.items.each { |item|
puts item.title
puts item.link
puts item.date
puts "---"
}

Which when run produces something along the lines of;
Bytes read 115009 from feed
Title: Geek Monkey
RSS URL: http://meekgonkey.blogspot.com/
Total entries: 25
Twitter from Ruby
http://meekgonkey.blogspot.com/2011/07/twitter-from-ruby.html
Thu, 21 Jul 2011 13:20:00 +0100
---
Github
http://meekgonkey.blogspot.com/2011/07/github.html
Mon, 18 Jul 2011 13:59:00 +0100
---
Google Plus
http://meekgonkey.blogspot.com/2011/07/google-plus.html
Fri, 01 Jul 2011 10:50:00 +0100
---
WATIR makes a tester's life easier.
http://meekgonkey.blogspot.com/2011/06/watir-makes-testers-life-easier.html
Wed, 29 Jun 2011 14:36:00 +0100
---
Setting browser size and position with watir-webdriver
http://meekgonkey.blogspot.com/2011/06/setting-browser-size-and-position-with.html
Thu, 23 Jun 2011 09:22:00 +0100
---




Doodle's Geek Monkey by Alastair Montgomery

Twitter from Ruby

Just been looking at Ruby Twitter gem by John Nunemaker during my lunch break.
Looking good so far, got my Twitter Dev key setup and have made a test post from a Ruby script.
1. Tweeting from Ruby
2......
3. Profit!!!


Doodle's Geek Monkey by Alastair Montgomery

Monday, 18 July 2011

Github

Finally got round to uploading some of my stuff to the GitHub site.
If you want a laugh have a look at my code alastairhm@github ;)


Doodle's Geek Monkey by Alastair Montgomery

Friday, 1 July 2011

Google Plus

Having my first look at Google+, so far looks nice.
Need to figure out if you can get a RSS feed of the items you've +'ed?

Having a play with Google+

Doodle's Geek Monkey by Alastair Montgomery