Source for file magpie_simple.php

Documentation is available at magpie_simple.php

  1. <?php
  2.  
  3. define('MAGPIE_DIR''../');
  4. require_once(MAGPIE_DIR.'rss_fetch.inc');
  5.  
  6. $url $_GET['url'];
  7.  
  8. if $url {
  9.     $rss fetch_rss$url );
  10.     echo "Channel: " $rss->channel['title'"<p>";
  11.     echo "<ul>";
  12.     foreach ($rss->items as $item{
  13.         $href $item['link'];
  14.         $title $item['title'];    
  15.         echo "<li><a href=$href>$title</a></li>";
  16.     }
  17.     echo "</ul>";
  18. }
  19. ?>
  20.  
  21. <form>
  22.     RSS URL: <input type="text" size="30" name="url" value="<?php echo $url ?>"><br />
  23.     <input type="submit" value="Parse RSS">
  24. </form>
  25.   
  26. <p>
  27. <h2>Security Note:</h2>
  28. This is a simple <b>example</b> script.  If this was a <b>real</b> script we probably wouldn't allow  strangers to submit random URLs, and we certainly wouldn't simply echo anything passed in the URL.  Additionally its a bad idea to leave this example script lying around.
  29. </p>

Documentation generated on Tue, 01 May 2007 16:44:46 +0200 by phpDocumentor 1.3.2