anyway, i was just playing around with rss things, and made this
i know people find rss parsing difficult......so...here u go
<?php $rss_tags = array( 'title', 'link', 'guid', 'comments', 'description', 'pubDate', 'category', ); $rss_item_tag = 'item'; $rss_url = 'http://www.pixel2life.com/feeds/adobe_fireworks.xml'; $rssfeed = rss_to_array($rss_item_tag,$rss_tags,$rss_url); echo '<pre>'; print_r($rssfeed); function rss_to_array($tag, $array, $url) { $doc = new DOMdocument(); $doc->load($url); $rss_array = array(); $items = array(); foreach($doc->getElementsByTagName($tag) AS $node) { foreach($array AS $key => $value) { $items[$value] = $node->getElementsByTagName($value)->item(0)->nodeValue; } array_push($rss_array, $items); } return $rss_array; } ?>
just set up what $rss_item_tag is - the is p2l case it is 'item'
then set up the array of tags inside that
then the url to the feed
and it will give u back an array of the feed so u can do wat u please with.
comments would be appreciated, cheers
Edited by curthard89, 21 July 2007 - 04:05 PM.