Launchpad logo and name.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index ][Thread Index ]

Using Launchpad feeds in Wordpress



Howdy,

I've blogged about using Launchpad feeds on Wordpress sites:

http://www.understated.co.uk/2008/launchpad-bug-feeds-in-wordpress/

Here's the how-to part:

Upgrade to the latest Wordpress

Before you begin, you should upgrade to the latest Wordpress.
Previously, I was running 2.2.2 and it had some trouble with the Atom
feed.
Pulling in the feed

First off, you need to pull in MagpieRSS, which is distributed with Wordpress.

I've created a sidebar specifically for the my site's home page and
I've got the following at the top of my home-sidebar.php template
file:

<?
include_once(ABSPATH . WPINC . '/rss.php');
$myBugs = fetch_rss("http://feeds.launchpad.net/~matthew.revell/latest-bugs.atom";);
$myBugsItems = array_slice($myBugs->items, 0, 4);
?>

The first line includes MagpieRSS and the next creates an array of the
feed's posts in $myBugs. I don't have too much room in my side bar, so
I use the last line to cut it down to the top four entries.
Displaying the feed

Actually displaying the feed is simple:

<ul>
<? foreach ($myBugsItems as $item ) {
	$title = $item[title];
	$url   = $item[link];
	echo "<li><a href=$url>$title</a></li>";
}

?>
</ul>

I'm looking forward to seeing how other people, in particular
projects, use these new feeds.

Please contact me if you're using Launchpad's feeds or you have a
suggestion for how we can improve them.

-- 
Matthew Revell - talk to me about Launchpad
Join us in #launchpad on irc.freenode.net




This is the launchpad-users mailing list archive — see also the general help for Launchpad.net mailing lists.

(Formatted by MHonArc.)