Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2012
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.63 KB | None | 0 0
  1. <?php
  2.  
  3. // Make sure SimplePie is included. You may need to change this to match the location of autoloader.php
  4. // For 1.0-1.2:
  5. #require_once('../simplepie.inc');
  6. // For 1.3+:
  7. require_once('../../php/autoloader.php');
  8.  
  9. // We'll process this feed with all of the default options.
  10. $feed = new SimplePie();
  11. $feed->set_cache_location($_SERVER['DOCUMENT_ROOT'] . '/cache');
  12. // Set which feed to process.
  13. $feed->set_feed_url(array(
  14.     'http://www.nyaa.eu/?page=rss&term=subdesu+chocolate+mkv+720',
  15.     'http://www.nyaa.eu/?page=rss&term=subdesu++dakara+mkv+720'
  16.     ));
  17.  
  18. // Run SimplePie.
  19. $feed->init();
  20.  
  21. // This makes sure that the content is sent to the browser as text/html and the UTF-8 character set (since we didn't change it).
  22. $feed->handle_content_type();
  23.  
  24. // Let's begin our XHTML webpage code.  The DOCTYPE is supposed to be the very first thing, so we'll keep it on the same line as the closing-PHP tag.
  25. ?>
  26. <?php foreach ($feed->get_items() as $item): ?>
  27. <rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  28.     <channel>
  29.         <title>Work</title>
  30.         <link>http://cal5not.dyndns.tv:8080/</link>
  31.         <atom:link href="http://cal5not.dyndns.tv:8080/DEV/transmission/test4.php" rel="self" type="application/rss+xml"/>
  32.         <description/>
  33.             <item>
  34.                 <title><?php echo $item->get_title(); ?></title>
  35.                 <![CDATA[<?php echo $item->get_description(); ?>]]>
  36.                 <link><?php echo $item->get_link() ;  ?></link>
  37.                 <guid><?php $guid = $item->get_item_tags('','guid'); $data = $guid[0]['data']; echo "$data"; ?></guid>
  38.                 <pubDate><?php echo $item->get_date('j F Y | g:i a'); ?></pubDate>
  39.             </item>
  40.     </channel>
  41. </rss>
  42. <?php endforeach; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement