Next read_later with del.icio.us
Playing with del.icio.us capabilities is becoming one of the funniest hobby.
Cedric suggests to use a read_later tag to mantain a to-read list with del.icio.us, and gives away a simple bookmarklet to automatically add a web page to that list (simply drag and drop the link into your toolbar).
Now it would be cool to have a button in my Mozilla/Firefox(/ehmmm….IE) toolbar that automatically loads the next web page in my del.icio.us to-read list. How can I do it?
First of all, I’m not a javascript guru, nor a php guru. So I’m going to describe a simple-dirty-ugly hack; but it works.
I created a php page called read_later.php. The content is mostly stolen by this Movable Blog post (requires MagPieRss):
<html>
<head>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<?php
require_once "../magpierss/rss_fetch.inc";
// change to reflect path of rss_fetch.inc
$yummy = fetch_rss("http://del.icio.us/rss/YOUR_ACCOUNT/read_later");
$yummyitems = array_slice($yummy->items, 0, 1);
foreach ($yummyitems as $yummyitem)
{
print '<META HTTP-EQUIV=Refresh CONTENT="0;';
print $yummyitem['link'];
print ‘">’;
}
?>
</head>
</html>
As you see, the generated page simply call a refresh, pointing to the first read_later link in your del.icio.us bookmarks. Then you just have to create a bookmark to this page; you will be automatically redirected to that page.
I know, I know, it’s not so technologically exciting… but it’s simple, and you can do that with a free or cheap php hosting.
(Sorry, comments are still closed… I haven’t had any time to set up an effective anti-spam strategy yet)
