use FeedCreator to generate syndicated feeds
This commit is contained in:
parent
a422968f92
commit
ed313cdea9
3 changed files with 1557 additions and 21 deletions
3
README
3
README
|
@ -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
|
||||||
=================
|
=================
|
||||||
|
|
1541
feedcreator.class.php
Normal file
1541
feedcreator.class.php
Normal file
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>
|
$rss->title = $feed_title;
|
||||||
<link>$feed_site_url</link>
|
$rss->link = $feed_site_url;
|
||||||
<generator>Tiny Tiny RSS v".VERSION."</generator>";
|
|
||||||
|
|
||||||
while ($line = db_fetch_assoc($result)) {
|
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"]));
|
$item = new FeedItem();
|
||||||
|
$item->title = $line["title"];
|
||||||
|
$item->description = $line["content_preview"];
|
||||||
|
$item->date = strtotime($line["updated"]);
|
||||||
|
$item->id = $line["guid"];
|
||||||
|
|
||||||
print "<pubDate>$rfc822_date</pubDate>";
|
$rss->addItem($item);
|
||||||
|
|
||||||
print "<title>" .
|
|
||||||
htmlspecialchars($line["title"]) . "</title>";
|
|
||||||
|
|
||||||
print "<description>" .
|
|
||||||
htmlspecialchars($line["content_preview"]) . "</description>";
|
|
||||||
|
|
||||||
print "</item>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</channel></rss>";
|
print $rss->createFeed($output_format);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue