phphtmlwordpressrssmuse

Extracting Elements from an RSS Feed


Is it possible to extract items from an RSS feed, such as the following: http://mudradio.wordpress.com/feed/

This is for my friend and he wants to have lots of wordpress blogs which are updated by different people all displayed on one site (which is created using Adobe Muse I think). I think he just wants the last update to be displayed on the site. Eg There may be pictures, videos (youtube) and audio (soundcloud) etc. The blog update may have lots of text and other stuff so I want it to filter the actual art content.

So the site may Look like:

|-----------|-----------|-----------|
|Blog 1     |Blog 2     |Blog 3     |
|Youtube Vid|Soundcloud |flickr img |
|-----------|-----------|-----------|

You get the picture.

So I thought if each blog has an RSS feed, use some sort of RSS filter to just get the video, audio etc and create a new RSS feed which can be inputted in the Adobe Muse site?

What does everyone think? Any better ideas? Anyone know how the RSS filtering could be done? I have just been attempting to use yahoo pipes but I'm not quite understanding it.


Solution

  • You can use Simplepie. Extracting data with Simplepie is piece of cake.

    require('simplepie.inc');
    
    $feed = new SimplePie("http://mudradio.wordpress.com/feed/");
    $feed->handle_content_type();
    
    echo $feed->get_title()."\n";
    
    foreach ($feed->get_items() as $item) {
        echo $item->get_title();
        echo $item->get_description();
    }
    

    And check the demo page too.