Skip to content

Instantly share code, notes, and snippets.

@BenWard
Forked from blowery/faves.php
Created August 17, 2009 20:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenWard/169375 to your computer and use it in GitHub Desktop.
Save BenWard/169375 to your computer and use it in GitHub Desktop.
<?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