From 7546b86c4b4d5913c8b1ba83eae9f92d99977c7e Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sat, 4 Aug 2012 00:05:24 +0200 Subject: [PATCH] Add avandu-tt-rss-version command Also add some doc fixes. --- avandu.el | 14 +++++++++++++- doc/avandu.texinfo | 13 +++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/avandu.el b/avandu.el index f7c7bb7..0c46426 100644 --- a/avandu.el +++ b/avandu.el @@ -401,7 +401,7 @@ feeds." (avandu--next-button-of-type backward feed)) (defun avandu-tt-rss-api-level () - "Get the API level of the your Tiny Tiny RSS instance." + "Get the API level of your Tiny Tiny RSS instance." (interactive) (let ((level (cdr (assq 'level (assq 'content @@ -412,6 +412,18 @@ feeds." level)) +(defun avandu-tt-rss-version () + "Get the version of your Tiny Tiny RSS instance." + (interactive) + (let ((version (cdr (assq 'version + (assq 'content + (avandu--send-command + '((op . "getVersion")))))))) + (when (called-interactively-p 'any) + (message "Tiny Tiny RSS Version: %s" version)) + + version)) + ;; Overview (define-derived-mode avandu-overview-mode special-mode "Avandu:Overview" "Major mode fo the avandu overview screen. diff --git a/doc/avandu.texinfo b/doc/avandu.texinfo index 3cd6ec3..dd0bc09 100644 --- a/doc/avandu.texinfo +++ b/doc/avandu.texinfo @@ -250,6 +250,19 @@ interactively in any way it will print a message like: API Level: # @end example +and it returns the api level as an integer. + This does not currently serve any purpose, but it might be used in the future to determine which functions are available. @end deffn + +@deffn Command avandu-tt-rss-version +Get the version of the Tiny Tiny RSS instance. If called +interactively in any way it will print a message like: + +@example +Tiny Tiny RSS Version: # +@end example + +and it returns the version as a string. +@end deffn