<?php require_once 'feeder.php'; $channel = array('title' => 'My Feed', 'author' => 'Proger_XP proger.xp@gmail.com http://proger.i-forge.net', 'description' => 'Just another PHP Feed', 'category' => 'http://example.com Category Label here.', 'category 2' => 'Second Label', 'icon' => '100x20 http://example.com/icon.gif', 'logo' => '121x83 http://example.com/logo.png'); $entries = array(array('title' => 'My first post', 'updated' => strtotime('22 Jan 2011'), 'author' => 'Proger_XP proger.xp@gmail.com', 'content' => 'Thinking about something to write...', 'content html' => 'Thinking about <em>something</em> to write…'), array('title' => 'Another filler', 'updated' => strtotime('23 May 2012'), 'author' => 'Proger_XP proger.xp@gmail.com', 'contributor' => 'Camilo http://camilomm.deviantart.com', 'content html' => 'Why? Because he\'s my friend <img src="smile.png" />')); $feeder = new Feeder(); $feeder->Channel()->SetFromArray($channel); foreach ($entries as $i => $entry) { $feeder->Entry($i, new FeedEntry($entry)); } $output = new AtomFeed(); $output->Output($feeder);
<?php require_once 'feeder.php'; $proger = new FeedPerson(); $proger->Name('Proger_XP'); $proger->EMail('*****@*****.**'); $proger->URL('http://proger.i-forge.net'); $camilo = new FeedPerson(); $camilo->Name('Camilo'); $camilo->URL('http://camilomm.deviantart.com'); $feeder = new Feeder(); $feeder->Channel()->Title()->Add('text', 'My Feed'); $feeder->Channel()->Author(0, $proger); $feeder->Channel()->Description()->Add('text', 'Just another PHP Feed'); $feeder->Channel()->BaseURL('http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/'); $entry = new FeedEntry(); $entry->Title()->Add('text', 'My first post'); $entry->Updated(strtotime('22 Jan 2011')); $entry->Author(0, $proger); $entry->Content()->Add('text', 'Thinking about something to write...'); $entry->Content()->Add('html', 'Thinking about <em>something</em> to write…'); $feeder->Entry(0, $entry); $entry = new FeedEntry(); $entry->Title()->Add('text', 'Another filler'); $entry->Updated(strtotime('23 May 2012')); $entry->Author(0, $proger); $entry->Contributor(0, $camilo); $entry->Content()->Add('html', 'Why? Because he\'s my friend <img src="smile.png" />'); $feeder->Entry(1, $entry); $output = new AtomFeed(); $output->Output($feeder);