Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Creating a new feed from magpierss

scopeuk
2006-07-19
2013-04-30
  • scopeuk
    scopeuk
    2006-07-19

    ok i realise this is a very basic script but it uses magpierss and rsswriter it relieson havign the rss10.inc and magpierss fodler inthe same folder as the script.
    i felt this script was simple enough for the cook book it searches for a string in the feed titles
    <?php
    require_once('magpierss/rss_fetch.inc');
    include("rss10.inc");
    $url = "http://feed.example.com/finalgeartorrents";
    $search = "string";
    $feed = fetch_rss($url);
    $rss=new RSSWriter($url, "Title", "Description");
            foreach ($feed->items as $item) {
                    $link = $item['link'];
                    $title = $item['title'];
                    $seek = ereg($search, $title);
                    if ($seek)
                    $rss->addItem( $link, $title);
            }
    $rss->serialize();
    ?>