]> git.wh0rd.org Git - tt-rss.git/commitdiff
api: add updateFeed
authorAndrew Dolgov <fox@bah.org.ru>
Wed, 16 Dec 2009 13:48:49 +0000 (16:48 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Wed, 16 Dec 2009 13:48:49 +0000 (16:48 +0300)
api/index.php

index 6126c3628d5bca26e203170d9cff949753de1077..b4f96764cca056a1568cb1520bae2274ef0bb11d 100644 (file)
 
                        break;
 
+               case "updateFeed":
+                       $feed_id = db_escape_string($_REQUEST["feed_id"]);
+
+                       $result = db_query($link, 
+                               "SELECT feed_url FROM ttrss_feeds WHERE id = '$feed_id'
+                                       AND owner_uid = " . $_SESSION["uid"]);
+
+                       if (db_num_rows($result) > 0) {                 
+                               $feed_url = db_fetch_result($result, 0, "feed_url");
+                               update_rss_feed($link, $feed_url, $feed_id);
+                       }
+
+                       break;
+
                case "getPref":
                        $pref_name = db_escape_string($_REQUEST["pref_name"]);
                        print json_encode(array("value" => get_pref($link, $pref_name)));