I’ve been using this PHP script to generate the daily “Links” posts from my del.icio.us links. Although the script works, it has some annoying bugs. For example, if there are no links for the day, it’ll still make a post which I have to manually delete. Furthermore, it’s written in PHP, a language I haven’t gotten around to learning, so I can’t fix or maintain it.
I decided to re-write the script in Perl, a language that I’m much more comfortable using. And so, I present my Daily del.icio.us Links Script for Wordpress. The code is pretty self-explanatory, and there are a few variables you’ll have to set.
Once the configuration variables are set, just add the script to your crontab — it should run once a day, around midnight, GMT time. It will use Net::Delicious to get a list of your del.icio.us links, filter out the links that don’t match the current date, create a nifty HTML version of your links, and post them to your Wordpress blog. If you’d like to see a sample of the output, click here.
Enjoy.
Note: It has come to my attention that del.icio.us now offers a service that does pretty much the same thing as my script, automatically. Natalie Downe has posted instructions on her blog for how to get the service to work with Wordpress blogs. If you want more control over your posts, though, I still recommend my script (OK, and maybe I’m a bit biased
).
Wordpress 2.3 Support: Thanks to everyone for bringing the WordPress 2.3 incompatibility to my attention. I am no longer an active user of del.icio.us. However, I do plan on releasing an update to my script that will provide support for the latest version of WordPress sometime during my Thanksgiving break. In the mean time, Edward de Leau has modified my script to support WordPress 2.3 and added some other nifty features.
Features:
- Completely self-contained, designed to run as a cronjob.
- Automatically filters out links not matching the current date.
- Adds links to tags used.
- Users may specify post slug, post title, and trackback/comment status.
- Uses Net::Delicious to maintain future compatibility with any del.icio.us API changes.
Changelog:
- 10/29/2005: Modified code to use Net::Delicious and DateTime Perl modules to maintain compatibility with future del.icio.us API changes and resolve timezone issues.
- 8/29/2005: Fixed reversal of
gmtime and localtime. Thanks squish!
- 5/9/2005: I’ve cleaned up the code and added the ability to add links back to the tags you used for a link.
Versions: