diff --git a/avandu.el b/avandu.el index 20d7a3f..c4af5c2 100644 --- a/avandu.el +++ b/avandu.el @@ -306,25 +306,13 @@ returned json." (kill-buffer buffer) result)) -;; Commands -(defun avandu-browse-article () - "Browse the current button's article url." - (interactive) - (let ((button (button-at (point)))) - (browse-url (button-get button 'link)) - (avandu-mark-article-read button))) - -(defun avandu-feed-catchup () - "Send a request to tt-rss to \"Catch up\" with a feed. This - means that all the (unread) articles in a feed will be marked - as read. After having completed this request the overview is - reloaded." - (interactive) - (let* ((button (button-at (point))) - (id (button-get button 'feed-id))) - (avandu--send-command `((op . "catchupFeed") - (feed_id . ,id)))) - (revert-buffer)) +(defun avandu-categories (&optional unread) + "Get the created categories. If UNREAD is non-nil only get +categories with feeds with unread articles in them." + (cdr (assq 'content + (avandu--send-command + `((op . "getCategories") + ,@(when unread `((unread_only . ,unread)))))))) (defun avandu-feeds (&optional category unread limit offset) "Get the subscribed feeds. If CATEGORY has been specified show @@ -346,6 +334,26 @@ There are a number of special category IDs: ,@(when limit `((limit . ,limit))) ,@(when offset `((offset . ,offset)))))))) +;; Commands +(defun avandu-browse-article () + "Browse the current button's article url." + (interactive) + (let ((button (button-at (point)))) + (browse-url (button-get button 'link)) + (avandu-mark-article-read button))) + +(defun avandu-feed-catchup () + "Send a request to tt-rss to \"Catch up\" with a feed. This + means that all the (unread) articles in a feed will be marked + as read. After having completed this request the overview is + reloaded." + (interactive) + (let* ((button (button-at (point))) + (id (button-get button 'feed-id))) + (avandu--send-command `((op . "catchupFeed") + (feed_id . ,id)))) + (revert-buffer)) + (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." diff --git a/doc/avandu.texinfo b/doc/avandu.texinfo index b1a8afb..8d12586 100644 --- a/doc/avandu.texinfo +++ b/doc/avandu.texinfo @@ -273,18 +273,3 @@ 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