I mentioned before that I was considering creating an RSS reader within WordPress so that I could read and respond within the same UI.

Well, I took the first steps today by finding out how easy it is to read an RSS feed in PHP. How easy? Ridiculously!

First, get the content of the feed with file_get_contents($feed_url) then create a base to work with $x = new SimpleXmlElement($content) so that individual elements can be pulled from the feed, like: $x->channel->title for the Feed title.

Using a foreach loop it's an easy matter of cycling through each element in the feed:

foreach($x->channel->item as $entry) {
    echo '<li><a href="' . $entry->link . '" title="' . $entry->title . '">' . $entry->title . '</a><br/>';
    echo $entry->description . '</li>';

See, it really is easy.

I'll be able to create a plugin, add all required feeds via an options page and cycle through the feeds. Alternatively, I might look at how to create a river, probably by building an array, and sorting it by date published.

Once that's done and I've made it look pretty, the tricky bit is going to be the integration with a posting solution.


  • Eli Mellen