Page 1 of 2

Plugin for Yourls.

Posted: 20 Mar 2013, 20:43
by Beun
I'd really like to have a Yourls plugin for TTRSS.
(For those of you not familiar with Yourls; Yourls is to Bitly what TTRSS is to Google Reader.)

This I know... I can send an URL to Yourls like this: http://MY_YOURLS/yourls-api.php?signatu ... imple&url=%@
(I also use this as a custom URL shortener in Tweetbot and Netbot)

So at the end of this, the %@ represents the URL you'd want to send to Yourls...But how to get that URL from TTRSS there...
I am not a developer, so I don't really know how to go about this... So I guess I'm asking if anyone here can help me out :D

Re: Plugin for Yourls.

Posted: 20 Mar 2013, 21:20
by richbeales
You should be able to copy what's been done by m.s in viewtopic.php?f=22&t=1422 and just (at a very basic level) find and replace "Kindle" with "Yourls", then change the share_url at the end of the js file with what you've written above.

Re: Plugin for Yourls.

Posted: 20 Mar 2013, 21:46
by Beun
Brilliant. I'll check it out :)

Re: Plugin for Yourls.

Posted: 21 Mar 2013, 01:30
by Beun
Here it is. A Yourls plugin for Tiny Tiny RSS.

Thanks to richbeales for pointing me in the right direction.

This plugin is based on the Kindle plugin, created by m.s..


yourls-plugin.zip
A plugin for sending a URL from Tiny Tiny RSS to Yourls.
(2.16 KiB) Downloaded 1472 times

Re: Plugin for Yourls.

Posted: 30 Mar 2013, 10:38
by acaranta
I allowed myself to modify your Yourls Plugin (thanks for your work) to add :
-The paramaters panel to set base url (ie : http://sho.rt) and API key straight from TTRSS prefs pane, this way different users can use different yourls installs
-A dialog/iframe to the shortened link response, instead of opening a news window ;)

BRgds,

yourls-ttrssplugin.zip
Check README.txt for more info ... if ever needed ;)
(3.3 KiB) Downloaded 1217 times

Re: Plugin for Yourls.

Posted: 30 Mar 2013, 11:10
by Beun
Brilliant. Thx. Way better like this.

Re: Plugin for Yourls.

Posted: 30 Mar 2013, 11:59
by acaranta
EDIT : Good version is available below
OK I couldn't stop thinking I needed more for these short urls automation ...

Here is therefore another version ;)
OK it uses php_curl (which might not be available on every hosting platforms i agree) to fetch the shortened url instead of a ugly iframe.
But it also adds Twitter and Facebook Share buttons (the FB share is deprecated I am aware, and it unshorten the url, yes but clickclickclick is lovely ;) )

Re: Plugin for Yourls.

Posted: 30 Mar 2013, 12:03
by HeikoAdams
I'm sorry, but your plugin doesn't work at least on trunk for the following reasons:
  • You use the theme_image function which is no longer available since v1.7.5 of ttrss
  • The db_escape_string function requiers as first param the db-link
  • The plugin can only be called one time. If I want to short another link nothing happens

Re: Plugin for Yourls.

Posted: 30 Mar 2013, 12:13
by acaranta
Argh damn ... let's edit the post and forget the last version for now, I'll check to modify these errors if possible asap ...

Thanks for your post.

Re: Plugin for Yourls.

Posted: 30 Mar 2013, 12:19
by acaranta
for the theme_image and the db_escape_string I know what happened ... we (Beun and I) used old plugins to code this one ... I'll check to make the correct changes ...

And for the multiple call impossible I thought I had corrected this ... I had a problem with the dialog shown ... I thought I had corrected this by adding "+ts" to dialog id... This seemed to work on my install ..

However I guess I am not using the latest trunk ttrss ... I'l changed this too I guess ;)

EDIT : yup I'm using v1.7.2 ...

Re: Plugin for Yourls.

Posted: 30 Mar 2013, 12:28
by HeikoAdams
Okay, my mistake the multiple call problem is fixed in your version. Sorry for that.

Re: Plugin for Yourls.

Posted: 30 Mar 2013, 22:23
by acaranta
No problem glad I fixed it as I thouhgt ;)

Re: Plugin for Yourls.

Posted: 30 Mar 2013, 23:48
by acaranta
Riiiight ... latest version 1.7.5 compliant plugin ;)

Seems to work for me ;) (upgraded to 1.7.5)

yourls-ttrssplugin-phpcurlneeded.zip
1.7.5 adjustements
(5.51 KiB) Downloaded 1523 times

Re: Plugin for Yourls.

Posted: 02 Apr 2013, 19:47
by acaranta
Just to be clean, versionned etc, the plugin is now available publicly here : https://github.com/acaranta/tt-rss-yourls
In case someone needs to edit it, correct it etc ;)

Hope Beun won't take it bad I do not mean to steal your work ;)

Re: Plugin for Yourls.

Posted: 11 Apr 2013, 17:48
by jdelamater99
I just wanted to say thank you to both of you for making this plug in. Late last night, the thought occurred to me that yourls would be a great integration and I should make one. Then, in a spark of genius powered by laziness and fatigue, I decided to search the forums first. And I'm glad that I did :D