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.
This commit is contained in:
Tom Willemsen 2012-08-04 01:31:55 +02:00
parent ea83dd8c2c
commit fb8e52c1dc
2 changed files with 35 additions and 2 deletions

View file

@ -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)

View file

@ -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