From 911d4c0836cf6d1be53be5917739defc91277a7e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 9 Sep 2010 16:49:06 +0400 Subject: add experimental digest thingie --- modules/backend-rpc.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'modules/backend-rpc.php') diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index b21e161e4..f8233a7cd 100644 --- a/modules/backend-rpc.php +++ b/modules/backend-rpc.php @@ -978,6 +978,42 @@ return; } + if ($subop == "digest-init") { + print ""; + + $tmp_feeds = api_get_feeds($link, false, true, false, 0); + $feeds = array(); + + foreach ($tmp_feeds as $f) { + if ($f['id'] > 0) array_push($feeds, $f); + } + + function feeds_sort_by_unread_rev($a, $b) { + $a = $a['unread']; + $b = $b['unread']; + + if ($a == $b) { + return 0; + } + return ($a < $b) ? 1 : -1; + } + +// uasort($feeds, 'feeds_sort_by_unread_rev'); +// $feeds = array_slice($feeds, 0, 10); + + print ""; + + $headlines = api_get_headlines($link, -4, 20, 0, + '', true, true, false, "all_articles", "updated DESC"); + + //function api_get_headlines($link, $feed_id, $limit, $offset, + // $filter, $is_cat, $show_excerpt, $show_content, $view_mode) { + + print ""; + print ""; + return; + } + print "Unknown method: $subop"; } ?> -- cgit v1.2.3