Recently in Web Category

A fellow former Bloglines user has asked me whether I found a way to backup Google Reader subscriptions into an OPML file from cron, as we used to do with our Bloglines accounts.

A quick search turned up this, which, from the look of it, in order for it to work requires every feed to be explicitly marked with a tag which is set up as public.

This by itself is rather cumbersome, and you have to remember to do that for every new feed you subscribe to, otherwise you’ll defeat the purpose of making periodic backups in the first place.

Luckily, there is a better solution. There is a nice little module on CPAN, WebService::Google::Reader by gray, which uses an unofficial Google Reader API to do various nifty things with your Google Reader subscription, including OPML export.

This means that after installing the module you can simply put the following command into your crontab (only command itself is shown, see crontab(5) manual page to find out what else you will want to put in there):

env GOOGLE_USERNAME=your-username-typically@gmail.com \
  GOOGLE_PASSWORD=your-user-password \
  perl -MWebService::Google::Reader -e \
  'print WebService::Google::Reader->new(
     username => $ENV{GOOGLE_USERNAME},
     password => $ENV{GOOGLE_PASSWORD})->opml' \
  > /where/to/put/greader.opml

You will have to make the above to be one long line to satisfy crontab syntax, and of course remember to use a real username, password, and the path to the resulting OPML file.

Unfortunately, the most recent version of the module (which is 0.03 at the time of this writing) has a minor bug which prevents the opml() method from working correctly. So you will need to do a little patching.

Before installing the module, edit the source file lib/WebService/Google/Reader/Constants.pm, look for a string subscribtions, and fix the spelling (finding correct spelling is left as an exercise for the reader). Then proceed installing the module as usual.

Hopefully, this step won’t be necessary in a couple of days’ time when a new version of the module is released.

If you are a FreeBSD user like myself, you may choose instead to fetch a skeleton of the port of the module. Unpack it in /usr/ports/www/ and install it as you would any other port.

I intend to add the port to the ports collection as soon as our current ports freeze is over.

Enjoy!

Space launch RSS feed

| No Comments

Spacelaunch

There is a nice list of space launches that covers all launches made since 2004.

Unfortunately, that page does not have an RSS feed. Since about 90% of the Web I see comes through various RSS feeds nowadays, I decided to give it a go and made a little scrapper that runs from cron and generates a custom feed. You can try it at http://www.tobez.org/comic2rss/space-launches.rss. Enjoy.

Make Yahoo Weather respect metric units

| No Comments

Although Yahoo Weather has a metric mode, it is, unfortunately, incomplete. The textual forecast still uses things like “29F” and “15 to 25 mph”. Since this is not very useful for the rest of us, :-) I wrote a Greasemonkey script which fixes the problem. It even tries to do something sensible when encountering things like “in the upper 30s”.

So “Low 29F. Winds E at 15 to 25 mph” gets converted into “Low -2C. Winds E at 24 to 40 kph”, while “Temps nearly steady in the low 30s” becomes “Temps nearly steady around 0C”.

A reasonably good URL to test this script would be: http://weather.yahoo.com/forecast/DAXX0009_c.html.

The latest version of the script can be found here.

Extended del.icio.us bookmarklet

| 1 Comment

Dan Phiffer came up with a really neat Google/del.icio.us greasemonkey userscript idea:

Use case: I search for “tuna sandwich” and Google brings up http://www.starkist.com/recipes/sandwiches/classictuna.html among a host of other tuna-related links. A Greasemonkey script pays attention to which link I click on and upon the click event, bookmarks this page with the tags “tuna” and “sandwich”.

People agreed that it is neat, but then Lenny Domnitser replied that the same could be easily and more conveniently accomplished with a simple modification of the “Post to del.icio.us” bookmarklet:

javascript:
var t,q=document.referrer.match(/q=([^&]+)/);
if(q){t='&tags='+q[1];}else{t=''}
location.href='http://del.icio.us/YOURDELICIOUS?url='+
encodeURIComponent(location.href)+'&title='+
encodeURIComponent(document.title)+t;

Simply replace YOURDELICIOUS with your del.icio.us account name, and make it one long line, then add it to your Firefox bookmarks.

Works like a charm, thanks, Lenny!

Bloglines keyboard shortcuts fix

| No Comments

Bloglines has recently introduced very nice keyboard shortcuts to jump around the feeds. Unfortunately, the “j” shortcut (“go to the next article”) is broken for larger font sizes. Hopefully, Bloglines team will fix this soon. Meanwhile, for your enjoyment, this Greasemonkey script does the job.

About this Archive

This page is an archive of recent entries in the Web category.

Rants is the previous category.

Find recent content on the main index or look in the archives to find all content.