Del.icio.us Postal Service
I haven’t been using del.icio.us an awful lot, I saw the potential but just never bothered. But now I’ve added a del.icio.us bookmarklet to safari and I’ve written a script to post my bookmarks to this here blog.
del.icio.us do actually offer their own tool for posting links to your blog but it’s rather obscure and doesn’t offer much in the way of customisation. Also it only lets you post them daily and I really do think that’s overkill, subscribers to your blog feed really don’t want your links thrown at them every single day. So i’ve made a quick php page to do it on demand, and i’ve added a cron job to cpanel which runs this once a month..
curl http://www.itchmerry.com/i’m/not/telling/you/where/it/is
Download delPost_php.txt here. You will need to change the extension before using it obviously.
When I started writing it I didn’t realise that php has an xml-rpc library. My php just constructs the xml as a big string and throws it at your blog server. But hey, it works? Just. Also, the del.icio.us api, such as it is, doesn’t offer a means of grabbing bookmarks between a date range. Either specified days, or a specified number of the most recent. My code currently grabs the 10 most recent. As I don’t use the service all that much I probably won’t add many more than 10 per month anyway. But to really be the months bookmarks the php code will need to pull each day of the month one after another, this would need some experimenting as it could take yonks to finish, and be a bit haphazard.
UPDATES: Version 0.0.5: Them silly amps + now displays html entities in the response.
Version 0.0.4: A few bug fixes + now includes “for the week of…” in the post’s subject.
Version 0.0.3 now collects del.icio.us links from a specified number of days. It takes longer because it’s calling back and forth from del.icio.us for each days worth. 7 Days seems ok though, so i think i’ll set it to fire weekly rather than monthly.
Turns out that php’s XML-RPC library is still at the experimental stage and isn’t included with the default php install. I’ll stick to constructing raw xml in code for now.
