function getHeadlines() { $feed_id = db_escape_string($_REQUEST["feed_id"]); if ($feed_id != "") { $limit = (int) db_escape_string($_REQUEST["limit"]); if (!$limit || $limit >= 60) { $limit = 60; } $offset = (int) db_escape_string($_REQUEST["skip"]); $filter = db_escape_string($_REQUEST["filter"]); $is_cat = (bool) db_escape_string($_REQUEST["is_cat"]); $show_excerpt = (bool) db_escape_string($_REQUEST["show_excerpt"]); $show_content = (bool) db_escape_string($_REQUEST["show_content"]); /* all_articles, unread, adaptive, marked, updated */ $view_mode = db_escape_string($_REQUEST["view_mode"]); $include_attachments = (bool) db_escape_string($_REQUEST["include_attachments"]); $since_id = (int) db_escape_string($_REQUEST["since_id"]); $include_nested = (bool) db_escape_string($_REQUEST["include_nested"]); $sanitize_content = true; /* do not rely on params below */ $search = db_escape_string($_REQUEST["search"]); $search_mode = db_escape_string($_REQUEST["search_mode"]); $match_on = db_escape_string($_REQUEST["match_on"]); $headlines = api_get_headlines($this->link, $feed_id, $limit, $offset, $filter, $is_cat, $show_excerpt, $show_content, $view_mode, false, $include_attachments, $since_id, $search, $search_mode, $match_on, $include_nested, $sanitize_content); print $this->wrap(self::STATUS_OK, $headlines); } else { print $this->wrap(self::STATUS_ERR, array("error" => 'INCORRECT_USAGE')); } }
function digestupdate() { $feed_id = db_escape_string($_REQUEST['feed_id']); $offset = db_escape_string($_REQUEST['offset']); $seq = db_escape_string($_REQUEST['seq']); if (!$feed_id) { $feed_id = -4; } if (!$offset) { $offset = 0; } $reply = array(); $reply['seq'] = $seq; $headlines = api_get_headlines($this->link, $feed_id, 30, $offset, '', $feed_id == -4, true, false, "unread", "updated DESC", 0, 0); $reply['headlines'] = array(); $reply['headlines']['title'] = getFeedTitle($this->link, $feed_id); $reply['headlines']['content'] = $headlines; print json_encode($reply); }
} print api_wrap_reply(API_STATUS_OK, $seq, $cats); break; case "getHeadlines": $feed_id = db_escape_string($_REQUEST["feed_id"]); $limit = (int) db_escape_string($_REQUEST["limit"]); $offset = (int) db_escape_string($_REQUEST["skip"]); $filter = db_escape_string($_REQUEST["filter"]); $is_cat = (bool) db_escape_string($_REQUEST["is_cat"]); $show_excerpt = (bool) db_escape_string($_REQUEST["show_excerpt"]); $show_content = (bool) db_escape_string($_REQUEST["show_content"]); /* all_articles, unread, adaptive, marked, updated */ $view_mode = db_escape_string($_REQUEST["view_mode"]); $include_attachments = (bool) db_escape_string($_REQUEST["include_attachments"]); $since_id = (int) db_escape_string($_REQUEST["since_id"]); $headlines = api_get_headlines($link, $feed_id, $limit, $offset, $filter, $is_cat, $show_excerpt, $show_content, $view_mode, false, $include_attachments, $since_id); print api_wrap_reply(API_STATUS_OK, $seq, $headlines); break; case "updateArticle": $article_ids = array_filter(explode(",", db_escape_string($_REQUEST["article_ids"])), is_numeric); $mode = (int) db_escape_string($_REQUEST["mode"]); $field_raw = (int) db_escape_string($_REQUEST["field"]); $field = ""; $set_to = ""; switch ($field_raw) { case 0: $field = "marked"; break; case 1: $field = "published"; break;