June 30, 200818 yr Ok I've tried at least 3 different bits of javascript which all work, but go through external sites and as such are both slow and unreliable. I haven't slept in 48 hours, would really appreciate some help!
June 30, 200818 yr Hi EggMan, have you tried using the Google Feed API. I use it on a few of my pages to display my latest blog and it seems to be fairly reliable and quick.
June 30, 200818 yr Author yep - but i put in my feedburner url (+standard feed url) and it just came up with 'no links found'
June 30, 200818 yr If you are using PHP you can use the function SimpleXMLElement to read from XML files (RSS is XML of course.) then display them in any format you want.
June 30, 200818 yr I seem to remember having problems pointing to the blog url when I set up Google Feed. Are you sure the url is correct? I'm sure it is but you never know.
July 1, 200818 yr Author yeah I triple checked it, even loaded it in a browser first then copied out the url - this is a nightmare! lol
July 1, 200818 yr The following code is something I got from somewhere but no longer know where. If anyone knows where it came from I will happily add credit to the author. It's php though so requires your pages to be .php's Include xml_parse.php in your head, and include feeds.php wherever you want the feed to appear. xml_parse.php <?php $insideitem = false; $tag = ""; $title = ""; $description = ""; $link = ""; function xml_reset(){ global $insideitem, $tag, $title, $description, $link; $insideitem = false; $tag = ""; $title = ""; $description = ""; $link = ""; } function startElement($parser, $name, $attrs) { global $insideitem, $tag, $title, $description, $link; if ($insideitem) { $tag = $name; } elseif ($name == "ITEM") { $insideitem = true; } } function endElement($parser, $name) { global $insideitem, $tag, $title, $description, $link; if ($name == "ITEM") { printf("<li class=\"menu\"><a href='%s' alt='%s' title='%s'>%s</a></li>", trim($link),htmlspecialchars(trim($description)), htmlspecialchars(trim($description)), htmlspecialchars(trim($title))); $title = ""; $description = ""; $link = ""; $insideitem = false; } } function characterData($parser, $data) { global $insideitem, $tag, $title, $description, $link; if ($insideitem) { switch ($tag) { case "TITLE": $title .= $data; break; case "DESCRIPTION": $description .= $data; break; case "LINK": $link .= $data; break; } } } ?> feeds.php (example with sitepoint) <a name="SitePoint"></a> <ul><b><a href="http://www.sitepoint.com">Site Point</a></b> <? $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); $fp = fopen("http://www.sitepoint.com/rss.php","r") or die("Error reading RSS data."); while ($data = fread($fp, 4096)) xml_parse($xml_parser, $data, feof($fp)) or die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); fclose($fp); xml_parser_free($xml_parser); xml_reset(); ?> </ul>
July 1, 200818 yr The following code is something I got from somewhere but no longer know where. If anyone knows where it came from I will happily add credit to the author. It's from the Sitepoint article on parsing RSS 1.0. I highly recommend the SimpleXML functionality in PHP if you can get your head around it, it makes things a lot easier. There is a good tutorial on reading RSS using SimpleXML here. I have to admit I haven't used it, but a quick browse shows it covers most of the bases.
July 2, 200818 yr Author Thank you both of you! I will give both your suggestions a try and let you know how I get on
July 2, 200818 yr Author Ok Eris, got your one working - only two things I can't figure out how to do. 1. Limit the number of items to display to just one 2. Stop it from displaying all my apostophes as code ?
July 2, 200818 yr I use Carp Evolution as my RSS to HTML script of choice - http://www.geckotribe.com/rss/carp/ - you can do anything you want witha feed. $50, ignore the shocking, salesy web design, it really is a great piece of software that you can install on your own server, also has a good support forum.
Create an account or sign in to comment