magpie templates. SMARTY examplesls
[moodle.git] / rss / magpie / scripts / magpie_simple.php
CommitLineData
b6442a5e 1<?php
2
3define('MAGPIE_DIR', '../');
4require_once(MAGPIE_DIR.'rss_fetch.inc');
5
6$url = $_GET['url'];
7
8if ( $url ) {
9 $rss = fetch_rss( $url );
10
11 echo "Channel: " . $rss->channel['title'] . "<p>";
12 echo "<ul>";
13 foreach ($rss->items as $item) {
14 $href = $item['link'];
15 $title = $item['title'];
16 echo "<li><a href=$href>$title</a></li>";
17 }
18 echo "</ul>";
19}
20?>
21
22<form>
23 RSS URL: <input type="text" size="30" name="url" value="<?php echo $url ?>"><br />
24 <input type="submit" value="Parse RSS">
25</form>