PageRenderTime 36ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/include/magpierss/scripts/magpie_slashbox.php

https://github.com/radicaldesigns/amp
PHP | 66 lines | 39 code | 16 blank | 11 comment | 1 complexity | 64cc0ec56ca4057aeecf885c1acd8d27 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0, BSD-3-Clause, LGPL-2.0, CC-BY-SA-3.0, AGPL-1.0
  1. <?php
  2. define('MAGPIE_DIR', '../');
  3. require_once(MAGPIE_DIR.'rss_fetch.inc');
  4. $url = $_GET['rss_url'];
  5. ?>
  6. <html
  7. <body LINK="#999999" VLINK="#000000">
  8. <form>
  9. <input type="text" name="rss_url" size="40" value="<?php echo $url ?>"><input type="Submit">
  10. </form>
  11. <?php
  12. if ( $url ) {
  13. echo "displaying: $url<p>";
  14. $rss = fetch_rss( $url );
  15. echo slashbox ($rss);
  16. }
  17. echo "<pre>";
  18. print_r($rss);
  19. echo "</pre>";
  20. ?>
  21. </body>
  22. </html>
  23. <?php
  24. # just some quick and ugly php to generate html
  25. #
  26. #
  27. function slashbox ($rss) {
  28. echo "<table cellpadding=2 cellspacing=0><tr>";
  29. echo "<td bgcolor=#006666>";
  30. # get the channel title and link properties off of the rss object
  31. #
  32. $title = $rss->channel['title'];
  33. $link = $rss->channel['link'];
  34. echo "<a href=$link><font color=#FFFFFF><b>$title</b></font></a>";
  35. echo "</td></tr>";
  36. # foreach over each item in the array.
  37. # displaying simple links
  38. #
  39. # we could be doing all sorts of neat things with the dublin core
  40. # info, or the event info, or what not, but keeping it simple for now.
  41. #
  42. foreach ($rss->items as $item ) {
  43. echo "<tr><td bgcolor=#cccccc>";
  44. echo "<a href=$item[link]>";
  45. echo $item['title'];
  46. echo "</a></td></tr>";
  47. }
  48. echo "</table>";
  49. }
  50. ?>