website diff scripts/get_feed.php @ rev 743

Tiny edits
author Paul Issott <paul@slitaz.org>
date Sat Jan 15 16:22:24 2011 +0000 (2011-01-15)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/scripts/get_feed.php	Sat Jan 15 16:22:24 2011 +0000
     1.3 @@ -0,0 +1,19 @@
     1.4 +<?php
     1.5 +
     1.6 +// Read Feed
     1.7 +function get_feed($feed_url) {
     1.8 +	$content = file_get_contents($feed_url);
     1.9 +	$x = new SimpleXmlElement($content);
    1.10 +	echo "<ul>";
    1.11 +	foreach($x->channel->item as $entry) {
    1.12 +		echo "
    1.13 +		<li>
    1.14 +		  <strong><a href='$entry->link' 
    1.15 +			title='$entry->title'>" . $entry->title . "</a></strong>
    1.16 +		  <p>$entry->description</p>
    1.17 +		</li>";
    1.18 +		}
    1.19 +	echo "</ul>";
    1.20 +}
    1.21 +
    1.22 +?>