]> git.wh0rd.org Git - tt-rss.git/commitdiff
weird magpie Atom parse workaround, feed is always updated when added (to get title...
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 27 Nov 2005 18:31:20 +0000 (19:31 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 27 Nov 2005 18:31:20 +0000 (19:31 +0100)
backend.php
functions.php

index 194d8ccd601852ae0ee09c5a3597da821e460c75..bcb1d5d5b1c66375906817390532104cbd7cae0b 100644 (file)
                                        $feed_id = db_fetch_result($result, 0, "id");
 
                                        if ($feed_id) {
-                                               update_rss_feed($link, $feed_link, $feed_id);
+                                               update_rss_feed($link, $feed_link, $feed_id, true);
                                        }
                                } else {
 
index a4156651e93b85016351fb76b3c727d02a390d4b..a0feae47e484a2ed35a3b4f3367c220a9b8b2841 100644 (file)
                }
        }
 
-       function update_rss_feed($link, $feed_url, $feed) {
+       function update_rss_feed($link, $feed_url, $feed, $ignore_daemon = false) {
 
                if (WEB_DEMO_MODE) return;
 
-               if (DAEMON_REFRESH_ONLY && !$_GET["daemon"]) {
+               if (DAEMON_REFRESH_ONLY && !$_GET["daemon"] && !$ignore_daemon) {
                        return;                 
                }
 
                                array_push($filters[$line["name"]], $line["reg_exp"]);
                        }
 
-                       foreach ($rss->items as $item) {
+                       $iterator = $rss->items;
+
+                       if (!$iterator) $iterator = $rss->entries;
+                       if (!$iterator) $iterator = $rss;                       
+
+                       foreach ($iterator as $item) {
        
                                $entry_guid = $item["id"];
        
                                $entry_timestamp_fmt = strftime("%Y/%m/%d %H:%M:%S", $entry_timestamp);
 
                                $entry_title = $item["title"];
-                               $entry_link = $item["link"];
+
+                               // strange Magpie workaround
+                               $entry_link = $item["link_"];
+                               if (!$entry_link) $entry_link = $item["link"];
 
                                if (!$entry_title) continue;
                                if (!$entry_link) continue;
 
                                $entry_content = $item["content:escaped"];
 
+                               if (!$entry_content) $entry_content = $item["summary"];
                                if (!$entry_content) $entry_content = $item["content:encoded"];
                                if (!$entry_content) $entry_content = $item["content"];
                                if (!$entry_content) $entry_content = $item["description"];