From fb8e52c1dc022538e3e5874cc12c021e05d1fb50 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sat, 4 Aug 2012 01:31:55 +0200 Subject: Add avandu-feeds command This command only returns a vector of feeds, it is not yet useful for users but will be used later to allow for different views of feeds. --- avandu.el | 22 ++++++++++++++++++++-- doc/avandu.texinfo | 15 +++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/avandu.el b/avandu.el index e875b5f..20d7a3f 100644 --- a/avandu.el +++ b/avandu.el @@ -326,6 +326,26 @@ returned json." (feed_id . ,id)))) (revert-buffer)) +(defun avandu-feeds (&optional category unread limit offset) + "Get the subscribed feeds. If CATEGORY has been specified show +only the feeds in CATEGORY. If UNREAD has been specified only +show feeds with unread articles in them. Only fets LIMIT +number of feeds, starting from OFFSET. + +There are a number of special category IDs: + 0 -- Uncategorized feeds + -1 -- Special (e.g. Starred, Published, Archived, etc.) feeds + -2 -- Labels + -3 -- All feeds, excluding virtual feeds (e.g. Labels and such) + -4 -- All feeds, including virtual feeds" + (cdr (assq 'content + (avandu--send-command + `((op . "getFeeds") + ,@(when category `((cat_id . ,category))) + ,@(when unread `((unread_only . ,unread))) + ,@(when limit `((limit . ,limit))) + ,@(when offset `((offset . ,offset)))))))) + (defun avandu-logged-in-p () "Send a request to tt-rss to see if we're (still) logged in. This function returns t if we are, or nil if we're not." @@ -500,8 +520,6 @@ by feed." ;; (id . 109)) ;; (login user password) -;; (get-counters output-mode) -;; (get-feeds category-id unread-only limit offset) ;; (get-categories unread-only) ;; (get-headlines feed-id limit skip filter categoryp show-excerpt show-content view-mode include-attachments since-id search search-mode match-on) ;; (update-article article-ids mode field data) diff --git a/doc/avandu.texinfo b/doc/avandu.texinfo index 8d12586..b1a8afb 100644 --- a/doc/avandu.texinfo +++ b/doc/avandu.texinfo @@ -273,3 +273,18 @@ Tiny Tiny RSS Version: # and it returns the version as a string. @end deffn + +@deffn avandu-feeds &optional category unread limit offset +Get a list of all the feeds in CATEGORY. If CATEGORY is @code{nil}, +unspicified or 0, show uncategorized feeds. + +If UNREAD is non-@code{nil} only get feeds with unread articles in +them. + +If LIMIT is non-@code{nil} only get LIMIT number of feeds and if +OFFSET is non-@code{nil} start at OFFSET. + +Returns a vector of all the feeds. This is not useful for users on +its own, but if will be used in the future to make more views +available. +@end deffn -- cgit v1.2.3-54-g00ecf