use FeedCreator to generate syndicated feeds

master
Andrew Dolgov 18 years ago
parent a422968f92
commit ed313cdea9

@ -14,8 +14,9 @@ Portions (C):
Sundar Dorai-Raj <sdoraira@vt.edu> (isNumeric() in functions.js) Sundar Dorai-Raj <sdoraira@vt.edu> (isNumeric() in functions.js)
Uses Prototype javascript library, from http://prototype.conio.net/ Uses Prototype javascript library, from http://prototype.conio.net/
Uses FeedCreator library, from http://www.bitfolge.de/rsscreator-en.html
Licensed under GNU GPL version 2 Tiny Tiny RSS is licensed under GNU GPL version 2
Features Overview Features Overview
================= =================

File diff suppressed because it is too large Load Diff

@ -19,6 +19,8 @@
require_once 'simplepie/simplepie.inc'; require_once 'simplepie/simplepie.inc';
} }
require_once "feedcreator.class.php";
define('MAGPIE_OUTPUT_ENCODING', 'UTF-8'); define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');
function purge_feed($link, $feed_id, $purge_interval, $debug = false) { function purge_feed($link, $feed_id, $purge_interval, $debug = false) {
@ -2360,7 +2362,7 @@
} }
function generate_syndicated_feed($link, $feed, $is_cat, function generate_syndicated_feed($link, $feed, $is_cat,
$search, $search_mode, $match_on) { $search, $search_mode, $match_on, $output_format = "RSS2.0") {
$qfh_ret = queryFeedHeadlines($link, $feed, $qfh_ret = queryFeedHeadlines($link, $feed,
30, false, $is_cat, $search, $search_mode, $match_on, "updated DESC"); 30, false, $is_cat, $search, $search_mode, $match_on, "updated DESC");
@ -2370,31 +2372,23 @@
$feed_site_url = $qfh_ret[2]; $feed_site_url = $qfh_ret[2];
$last_error = $qfh_ret[3]; $last_error = $qfh_ret[3];
print "<rss version=\"2.0\"> $rss = new UniversalFeedCreator();
<channel>
<title>$feed_title</title>
<link>$feed_site_url</link>
<generator>Tiny Tiny RSS v".VERSION."</generator>";
while ($line = db_fetch_assoc($result)) {
print "<item>";
print "<id>" . htmlspecialchars($line["guid"]) . "</id>";
print "<link>" . htmlspecialchars($line["link"]) . "</link>";
$rfc822_date = date('r', strtotime($line["updated"])); $rss->title = $feed_title;
$rss->link = $feed_site_url;
print "<pubDate>$rfc822_date</pubDate>"; while ($line = db_fetch_assoc($result)) {
print "<title>" .
htmlspecialchars($line["title"]) . "</title>";
print "<description>" . $item = new FeedItem();
htmlspecialchars($line["content_preview"]) . "</description>"; $item->title = $line["title"];
$item->description = $line["content_preview"];
$item->date = strtotime($line["updated"]);
$item->id = $line["guid"];
print "</item>"; $rss->addItem($item);
} }
print "</channel></rss>"; print $rss->createFeed($output_format);
} }

Loading…
Cancel
Save