Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b6442a5e3a
Fetching contributors…

Cannot retrieve contributors at this time

executable file 41 lines (33 sloc) 0.814 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
<?php

ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);

define('MAGPIE_DIR', '../');
define('MAGPIE_DEBUG', 2);
// flush cache quickly for debugging purposes, don't do this on a live site
define('MAGPIE_CACHE_AGE', 2);

require_once(MAGPIE_DIR.'rss_fetch.inc');

$url = $_GET['url'];

if ( $url ) {
$rss = fetch_rss( $url );

if ($rss) {
echo "Channel: " . $rss->channel['title'] . "<p>";
echo "<ul>";
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
echo "<li><a href=$href>$title</a></li>";
}
echo "</ul>";
}
else {
echo "Error: " . magpie_error();
}
}
?>

<form>
RSS URL: <input type="text" size="30" name="url" value="<?php echo $url ?>"><br />
<input type="submit" value="Parse RSS">
</form>

<pre>
<?php var_dump($rss); ?>
</pre>
Something went wrong with that request. Please try again.