From: Christian Weiske Date: Wed, 8 Jul 2015 22:47:16 +0000 (+0200) Subject: initial version X-Git-Tag: v0.2.0~2 X-Git-Url: https://git.cweiske.de/tt-rss-subtome.git/commitdiff_plain/87f0b31d2f7b375fb6754893d41cde468a88c8e1 initial version --- 87f0b31d2f7b375fb6754893d41cde468a88c8e1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..daa30a3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +README.html diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..e1c7c3a --- /dev/null +++ b/README.rst @@ -0,0 +1,41 @@ +******************************** +SubToMe plugin for Tiny Tiny RSS +******************************** + +Allows users to register their `Tiny Tiny RSS`__ instance at `subtome.com`__. +Once done, they can subscribe to feeds with only two clicks. + +__ https://tt-rss.org/ +__ https://www.subtome.com/ + + +===== +Usage +===== +#. Go to Tiny Tiny RSS preferences. +#. You'll see a new panel "SubToMe". Click on it. +#. Click the "Add TT-RSS to SubToMe.com" button. + + If you want, you can adjust the name before. + + +============ +Installation +============ +Clone this repository into the ``plugins.local/`` directory of your +TT-RSS folder:: + + $ cd /path/to/tt-rss/ + $ cd plugins.local/ + $ git clone git://git.cweiske.de/tt-rss-subtome.git + +Then enable the plugin in the preferences. + + +===== +About +===== +The Tiny Tiny RSS SubToMe plugin was written by `Christian Weiske`__ +and is licensed under the AGPLv3 or later. + +__ cweiske+subtome@cweiske.de diff --git a/init.php b/init.php new file mode 100644 index 0000000..4f624ff --- /dev/null +++ b/init.php @@ -0,0 +1,97 @@ + + * @license AGPLv3 or later + * @link http://docs.subtome.com/developers/ + * @link https://tt-rss.org/redmine/projects/tt-rss/wiki/FrequentlyAskedQuestions#I-need-a-URL-I-can-call-to-subscribe-to-feed-to-integrate-with-some-third-party-browser-extensionapplication + */ +class SubToMe extends Plugin +{ + public function about() + { + return array( + 0.1, + 'Add TT-RSS to SubToMe.com', + 'cweiske', + false//not a system plugin + ); + } + + public function init($host) + { + $host->add_hook($host::HOOK_PREFS_TAB, $this); + } + + public function hook_prefs_tab($args) + { + if ($args != "prefPrefs") { + return; + } + + $ttSubscribeUrl = get_self_url_prefix() + . '/public.php?op=subscribe&feed_url={url}'; + + $regUrl = 'https://www.subtome.com/register-no-ui.html' + . '?name=##NAME##' + . '&url=' . urlencode($ttSubscribeUrl); + $jRegUrl = json_encode($regUrl); + + echo << +
+ + + + + + + + +

Configure SubToMe

+ + + +
+

+ + +

+
+ +

Testing

+

+ Try the "Subscribe" button on + blog.superfeedr.com. +

+ +HTM; + } + + public function api_version() + { + return 2; + } +} +?>