Post Google Reader Shared Items to Delicious

As you can probably tell if you read this site, I'm a fan of Delicious. I regularly bookmark sites, images, or files I've found on the Web at Delicious and add a note or summary. Half of my motivation is finding links I want to get back to and half is sharing the link with others. That's why I also auto-post my Delicious links here once a day and mark them with "gathered from delicious".

Over on the other side of the Web I use Google Reader to keep up with the world. So naturally I find a lot of interesting links there and want to post them to Delicious. 90% of time I just click to the original source and hit the Delicious Bookmark button in my browser if I want to post the link. But Google Reader has a feature similar to Delicious called Google Reader Shared Items. If there's something I know I want to share even without visiting the original source, I just click a button and it's shared with the world.

But what if I want to cross the streams? I already have something that imports links from Delicious to my blog, I like their service for searching links, and it seems like I should be able to easily bookmark within Google Reader for the 10% of links I share there. Well, of course Google doesn't offer that integration because they have a competing product. In that case: Greasemonkey to the rescue, no? Well, I tried every script that attempts to add a Delicious button to Google Reader and none of them worked. (I'm guessing Google is either actively thwarting these scripts, or the script authors don't have time to keep up with Google's HTML changes.) So it was time to roll my own. But I don't want to keep up with Google's changes either, so Greasemonkey is out. There had to be a better way.

Google offers the shared items as an ATOM feed which makes scripting them fairly easy. You can find your shared items feed by logging into Google Reader, clicking "shared items" in the top-left menu, click "at this webpage" in the shared items note, and then you'll find the URL at the "atom feed" link in the popup. (shew.) I decided to import my Google Reader shared items into Delicious with a Perl script I can run on a schedule. Since there are so many Greasemonkey scripts out there to do this kind of thing I thought it might be worth sharing:

greadertodelicious.pl (click for the source)

To use this script you'll need a couple of Perl modules: XML::Atom::Syndication for parsing the Google Reader feed and Net::Delicious for posting via the Delicious API. Once installed, edit the script to include your Google Reader shared items feed URL, Delicious user/pass, and then save the file as greadertodelicious.pl. Run the script every so often with cron, and your Google Reader shared items should start showing up at Delicious.

Here are a couple snags I hit. You can tag items at Google Reader, but unfortunately Google doesn't make your tags available in the shared items feed. For now I'm simply tagging imported items with "googlereader", and adding appropriate tags at Delicious. I also didn't want to import all of my older shared items, so in the script I set a start date with timelocal() and compare it with each shared item's cryptically labeled crawl-timestamp-msec—as it turns out that's the time the item was shared as a Unix-ish timestamp. If the item was shared before the start date set in the script, it's not posted to Delicious.
  • YSlow has a nice new design, and a new option for "Small Site or Blog" that doesn't grade based on clustered server settings.
  • Bruce Sterling is taking over as editor of Cool Tools. Neat.
  • "Open, decentralized micropublishing." A distributed Twitter sounds fine, but don't we already have this in the form of "weblogs" and "newsreaders"--and without the 140 character restraint?!

Music Share: Here Comes the Sun

Woke up with Peter Tosh's version of Here Comes the Sun in my head. You can too!

Tulips

tulip farm

tulips
  • Jesse talks with Brooke Gladstone and Bob Garfield about their excellent NPR program On The Media. It's the only NPR show I listen to religiously, and it's fascinating to hear some behind-the-scenes info.

CA Sunset

CA Sunset

Music Share: Cast Your Fate To The Wind

Vince Guaraldi became famous for writing the music for the Peanuts TV specials, especially the iconic theme song Linus & Lucy. A few years before hooking up with Charles Schultz and crew he had an unexpected hit with Cast Your Fate To The Wind, a B-Side. Try listening to the song without picturing the Peanuts characters walking from one location to another:



It's from the 1962 Vince Guaraldi Trio album Jazz Impressions of Black Orpheus. There must be something about hearing music as a kid that embeds it into your psyche. Even Vince Guaraldi tracks that I haven't heard before sound familiar—like I've heard them all my life.
« Older posts  /  Newer posts »