Changed two of my PHP scripts which fetch RSS from del.icio.us and render my 43things goals for the sidebar.
The scripts were taken from “Integrating del.icio.us with PHP and Magpie” article at MovableBlog. This code works but not GoodEnoughTM – from time to time the feeds were unavailable which resulted in an error message that screwed up my layout. I took the idea from Magpie RSS FAQ to suppress errors and make it display a less obtrusive message. I have also tweaked the code here and there. The result can be seen below:
<?php
// change to reflect path of rss_fetch.inc
require_once "lib/rss_fetch.inc";
// Suppresses MagpieRSS errors
error_reporting(E_ERROR);$yummy = fetch_rss("http://del.icio.us/rss/user_name");$maxitems = 5;
if ($yummyitems = array_slice($yummy->items, 0, $maxitems)) { print '';
foreach ($yummyitems as $yummyitem) {
print '';
print '<a href="';
print $yummyitem['link'];
print '">'; if ($yummyitem['title'] != '')
echo htmlspecialchars($yummyitem['title']);
else
print '[No title]'; print '</a>';
if (isset($yummyitem['description'])) {
print ': ';
echo htmlspecialchars($yummyitem['description']);
}
print '';
print "\n";
}
print '';
} else {
// since errors are suppressed,
// here is a gentle way to tell you what's happened
print '' . magpie_error() . '';
}
?>
Notes: You can replace URL of del.icio.us with just about any other feed (RSS v0.91-v2.0, Atom). You can also change the amount of displayed links by replacing $maxitems = 5 with desired number of items.

