3 * Allows user to register their Tiny Tiny RSS instance at subtome.com,
4 * so that they can subscribe to feeds with a few clicks.
8 * @author Christian Weiske <cweiske@cweiske.de>
9 * @license AGPLv3 or later
10 * @link http://docs.subtome.com/developers/
11 * @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
13 class SubToMe extends Plugin
15 public function about()
19 'Add TT-RSS to SubToMe.com',
21 false//not a system plugin
25 public function init($host)
27 $host->add_hook($host::HOOK_PREFS_TAB, $this);
30 public function hook_prefs_tab($args)
32 if ($args != "prefPrefs") {
36 $ttSubscribeUrl = get_self_url_prefix()
37 . '/public.php?op=subscribe&feed_url={url}';
39 $regUrl = 'https://www.subtome.com/register-no-ui.html'
41 . '&url=' . urlencode($ttSubscribeUrl);
42 $jRegUrl = json_encode($regUrl);
45 <div dojoType="dijit.layout.AccordionPane" title="SubToMe">
46 <form dojoType="dijit.form.Form" id="subtome_reg_form">
47 <script type="dojo/method" event="onSubmit" args="evt">
49 if (this.validate()) {
50 var regUrl = $jRegUrl.replace(
51 '##NAME##', document.getElementById("subtome_name").value
53 var me = document.getElementById('subtome_reg_form');
54 me.insertAdjacentHTML(
56 '<iframe style="display:none;" src="' + regUrl + '" />'
58 document.getElementById("subtome_done").style = "";
62 <table width="100%" class="prefPrefsList">
63 <tr><td colspan="2"><h3>Configure SubToMe</h3></td></tr>
65 <td width="40%" class="prefName">
66 <label for="subtome_name">Name</label>
68 <td class="prefValue">
69 <input name="subtome_name" id="subtome_name" type="text" size="20" value="Tiny Tiny RSS" dojoType="dijit.form.TextBox"/>
74 <input type="submit" value="Add TT-RSS to SubToMe.com"/>
75 <span id="subtome_done" style="display: none">
76 <input type="checkbox" checked="checked" value="1"
77 dojoType="dijit.form.CheckBox" />
78 Registration finished!
85 Try the "Subscribe" button on
86 <a href="http://blog.superfeedr.com/">blog.superfeedr.com</a>.
92 public function api_version()