Specific example for OpenSourceXperts.com (PHP)

This example uses the Magpie RSS Library. You'll need to download the library and upload it to your web server. In the folder where you are running your RSS parsing scripts, create a directory called cache and set permissions (typically chmod 777) so that your code/webserver can write to it. Magpie RSS will automatically try to cache the feeds locally.

That being said, you should be able to look at the magpie_simple.php file and edit it to include it in your website. I've used the following bit of code to integrate it directly into my sample page:

  include("magpie_simple.php");

As you can see on that page, it is very easy to get an output showing all the items in a feed. The main thing to be aware of when parsing the (current, 2004-01-18) OpenSourcExperts.com Solution Provider Feeds is that they include custom tags and enclosures. Enclosures are part of RSS 2.0, so aren't supported by Magpie. Custom tags (the osx:--- ones) need to be parsed explicitly. The preferred behaviour would be to output nicely formatted and CSS-tagged XHTML directly into the description tag. For OSX, the "description" field contains the personalized info about a provider. All other information is encoded in "special" fields. Here is a sample (this is my listing):

<enclosure url="http://www.opensourcexperts.com/logos/116" length="7428" type="image/jpeg" />
<link>http://www.opensourcexperts.com/Index/Companies/PHP/A106856768441.html</link>
<osx:website>http://www.bmannconsulting.com</osx:website>
<osx:location>Canada, Ontario</osx:location>
<description>Installation of any PHP-based web applications. Custom PHP coding.</description>
<osx:type>Individual Consultant</osx:type>
<osx:rating>0.0</osx:rating>

Magpie RSS will parse these special fields, but you'll have to do some extra coding to get at them. This following code snippet would print out a link to the website of a solution provider, if they entered one.

foreach ($rss->items as $item) {
  $website = $item['osx']['website'];
  if ($website) {
    print "<a href=\"$website\">$website</a>";
  }
}

The other special fields can be accessed the same way. I have created two sample layouts, Business Card Style and Sidebar Style, as examples of what kind of information can be parsed from the feeds.