HOWTO List del.icio.us Bookmarks in WordPress
Note: WordPress 1.5 has been released! Figures, I only just installed the latest beta the other day. :)
I've been using del.icio.us (god I hate typing that url) quite a bit lately and I found this page that shows an easy way to post your del.icio.us bookmarks using php and a simple rss parser. I wanted to integrate it into a seperate "Page" in WordPress. (new feature in 1.5) If you look at the top of this page you'll see this bookmarks link. I wanted to stop posting links as stories on this blog, so this allows me to keep a seperate link blog kind of thing. Here's how I did it...
WordPress 1.5 has this neat new feature that lets you create "static" pages seperate from your blog posts. Unfortunately, there doesn't seem to be an easy way to put your own php code inside these pages. Then I realized you can assign templates to the page you're creating and inside that template file you can have all your php code. I never was very good at writing documentation, but here goes:
Step 1: Download the magpie rss include files. Extract the archive and copy the 4 .inc files to your template directory. (by default, thats wp-content/themes/default) Also make a directory under there called extlib and copy the extlib/Snoopy.class.inc to that directory.
Step 2: Create a file in your theme directory called bookmarks.php. In order for it to show up on the Write Page menu under template, you need that comment at the top that says Template Name: Bookmarks. Also change the two instances of $username to your del.icio.us name:
My last 30 del.ico.us links
-
items, 0, $maxitems);
foreach ($yummyitems as $yummyitem) {
print '
- '; print ''; print $yummyitem['title']; print ''; if (isset($yummyitem['description'])) { print ': '; print $yummyitem['description']; } print ' '; print "\n"; } ?>
Step 3: In WordPress goto Write -> Write Page and for Page Template select Bookmarks. You can leave the Page Content blank.
Update: I seem to be having some weird problems with it not updating sometimes. Anyone more knowledgable about the new "Page" feature in WordPress? It's almost as if WordPress is caching the result beyond the rss caching of magpie...
Trackbacks
Use the following link to trackback from your own site:
http://juju.org/articles/trackback/332
Comments
Leave a response, Track co.mments
Juju