1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2026-01-28 05:07:11 +00:00

basic functionality pass 10

This commit is contained in:
Andrew Dolgov
2005-08-22 05:56:40 +01:00
parent 857a92708b
commit 331900c642
7 changed files with 166 additions and 107 deletions

View File

@@ -4,7 +4,7 @@
function update_all_feeds($link) {
$result = pg_query($link, "SELECT feed_url,id FROM ttrss_feeds WHERE
last_updated is null OR
last_updated is null OR title = '' OR
EXTRACT(EPOCH FROM NOW()) - EXTRACT(EPOCH FROM last_updated) > " .
MIN_UPDATE_TIME);
@@ -19,6 +19,16 @@
$rss = fetch_rss($feed_url);
if ($rss) {
$result = pg_query("SELECT title FROM ttrss_feeds WHERE id = '$feed'");
$registered_title = pg_fetch_result($result, 0, "title");
if (!$registered_title) {
$feed_title = $rss->channel["title"];
pg_query("UPDATE ttrss_feeds SET title = '$feed_title' WHERE id = '$feed'");
}
foreach ($rss->items as $item) {
@@ -30,7 +40,9 @@
$entry_timestamp = $item["pubdate"];
if (!$entry_timestamp) $entry_timestamp = $item["modified"];
if (!$entry_timestamp) $entry_timestamp = $item["updated"];
if (!$entry_timestamp) continue;
$entry_timestamp = strtotime($entry_timestamp);
if (!$entry_timestamp) continue;