From: Andrew Dolgov Date: Wed, 16 Dec 2009 10:07:02 +0000 (+0300) Subject: api: add getUnread X-Git-Tag: 1.4.0~183^2~12 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=03e5f9eb02d7f4f7144a0829968a7e087269ee05;p=tt-rss.git api: add getUnread --- diff --git a/api/index.php b/api/index.php index 3bb83e1b..b0a084ce 100644 --- a/api/index.php +++ b/api/index.php @@ -73,6 +73,16 @@ case "isLoggedIn": print json_encode(array("status" => $_SESSION["uid"] != '')); break; + case "getUnread": + $feed_id = db_escape_string($_REQUEST["feed_id"]); + $is_cat = db_escape_string($_REQUEST["is_cat"]); + + if ($feed_id) { + print json_encode(array("unread" => getFeedUnread($link, $feed_id, $is_cat))); + } else { + print json_encode(array("unread" => getGlobalUnread($link))); + } + break; case "getFeeds": $cat_id = db_escape_string($_REQUEST["cat_id"]); $unread_only = (bool)db_escape_string($_REQUEST["unread_only"]);