March 30, 2005

Ruby Bloglines OSD Notifier

Another little bit of somewhat useful code: bloglinesosd.rb. It’s pretty basic - it checks bloglines for unread entries and displays a count using the xosd library. Enjoy, and as always have the appropriate amount of fun.

Posted by Bill Stilwell at 09:02 PM

March 26, 2005

Delicious autocomple

Del.Icio.Us Auto-Complete - another awesome greasemonkey user script; provides autocomplete for your tags when using the del.icio.us bookmark service.

Posted by Bill Stilwell at 12:38 PM

March 24, 2005

Ruby Flickr Upload Script

I’ve been playing around with Ruby for a while, and finally came up with something useful: rflick.rb, an uploader script written in Ruby. (You can definitely pick your language when it comes to command line uploaders.)

The actual development of the script was fairly easy: ruby’s built in support for option parsing, YAML, and XML made things simple. The only irritating part was the HTTP POST of the image file, which I found is not supported by the ruby’s (otherwise excellent) standard http lib. (In case you think this an unreasonable expectation, perl does this.) A rousing bout of googling lead me to this, which I used to extract a reasonably generic multipart/form-data helper class.

This is the first public release, so please let me know if you use it and if you discover any problems. If you’re a developer looking for the rest of the flickr API in Ruby, you want this. (Which I initially found here, which lead to the creation of the upload script. And now you know… the rest of the story.)

Posted by Bill Stilwell at 09:59 PM

March 17, 2005

Ignorance is bliss

I thought this greasemonkey userscript, which automatically ignores stories about Michael Jackson in the reuter’s feed in bloglines, was pretty clever, but it’s not nearly agressive enough about hiding things I don’t want to know about. A wee bit of hackery later, I present: Mental Health Through Ignorance, a greasemonkey script that will hide any stories matching specified strings. A link is provided if you want to risk your zen state and read the hidden story.

By default, anything with the strings ‘michael jackson’ or ‘scott peterson’ are ignored. If you want to change this script to alter the strings that will trigger the hiding behaviour, here’s what you do:

  1. Download the script into a text file on your computer; you can call it anything you want as long as it ends with .user.js
  2. look for the line var toMatch = ["michael jackson", "scott peterson"];
  3. let’s say you wanted to add Robert Blake and OJ Simpson to the list and remove Scott Peterson, you would change this line to read: var toMatch = ["michael jackson", "robert blake", "oj simpsons"];. The rule is to put the bits you want matched between quotes, with the bits separated by commas. (Aside to people who know what they’re doing and are wondering about using regexps: go crazy. Whatever you put in the array is compiled to regexp objects and used as the matcher.)
  4. save the file and open it in your browser. Click Tools/Install User Script. You’re done.

Happy blissful ignorance!

Update: A wee bit of tweaking: the text informing you of a hidden story now gives you the matched text. Fixed problem where multiple matches meant you couldn’t view the story (although really, you probably shouldn’t).

PS: I am a complete neophyte when it comes to JavaScript and DOM; using this code as an example of how to do things is probably unwise with a capital UN.

Posted by Bill Stilwell at 05:22 PM

March 09, 2005

Easy XPath Fiddling

It’s always a pleasure to find a tool that is easy to try out, and XPath Explorer certainly fits the bill: download a jar, run it with java -jar, and you’re testing XPath expressions. No dependency hell, no tracking down libs from a thousand sourceforge and jakarta sites. Nice.

Posted by Bill Stilwell at 04:56 PM