Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
if (isset($_GET['errors'])) { error_reporting(E_ALL); } else { error_reporting(0); }
// Requires the Universal Feed Writer from http://www.phpclasses.org/browse/package/4427.html
include("FeedWriter.php");
define('FIREWALLED', true);
define('FIREWALL_ROOT', 'firewall/');
include(FIREWALL_ROOT.'config/db.php');
$feed = new FeedWriter(ATOM);
$feed->setTitle("A title");
$feed->setLink("http://your/site/here");
$feed->setDescription("My saved items in Fever");
mysql_connect(FEVER_DB_SERVER, FEVER_DB_USERNAME, FEVER_DB_PASSWORD);
mysql_select_db(FEVER_DB_DATABASE);
$result = mysql_query("select * from fever_items where is_saved = 1 order by added_on_time desc limit 20;");
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
$newItem = $feed->createNewItem();
$newItem->setTitle($row["title"]);
$newItem->setDescription($row["description"]);
$newItem->setDate($row["added_on_time"]);
$newItem->setLink($row["link"]);
$feed->addItem($newItem);
}
$feed->genarateFeed(); // [sic] yes they really misspelled generate. *sigh*
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment