Plugin for Yourls.

Post plugins and custom CSS snippets here
Beun
Bear Rating Trainee
Bear Rating Trainee
Posts: 35
Joined: 06 Aug 2008, 20:01

Plugin for Yourls.

Postby Beun » 20 Mar 2013, 20:43

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

richbeales
Bear Rating Trainee
Bear Rating Trainee
Posts: 9
Joined: 15 Mar 2013, 18:04
Location: UK
Contact:

Re: Plugin for Yourls.

Postby richbeales » 20 Mar 2013, 21:20

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.

Beun
Bear Rating Trainee
Bear Rating Trainee
Posts: 35
Joined: 06 Aug 2008, 20:01

Re: Plugin for Yourls.

Postby Beun » 20 Mar 2013, 21:46

Brilliant. I'll check it out :)

Beun
Bear Rating Trainee
Bear Rating Trainee
Posts: 35
Joined: 06 Aug 2008, 20:01

Re: Plugin for Yourls.

Postby Beun » 21 Mar 2013, 01:30

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 1352 times

User avatar
acaranta
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 30 Mar 2013, 10:30

Re: Plugin for Yourls.

Postby acaranta » 30 Mar 2013, 10:38

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 1111 times

Beun
Bear Rating Trainee
Bear Rating Trainee
Posts: 35
Joined: 06 Aug 2008, 20:01

Re: Plugin for Yourls.

Postby Beun » 30 Mar 2013, 11:10

Brilliant. Thx. Way better like this.

User avatar
acaranta
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 30 Mar 2013, 10:30

Re: Plugin for Yourls.

Postby acaranta » 30 Mar 2013, 11:59

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 ;) )
Last edited by acaranta on 03 Apr 2013, 12:59, edited 3 times in total.

User avatar
HeikoAdams
Bear Rating Master
Bear Rating Master
Posts: 101
Joined: 19 Mar 2013, 00:17

Re: Plugin for Yourls.

Postby HeikoAdams » 30 Mar 2013, 12:03

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

User avatar
acaranta
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 30 Mar 2013, 10:30

Re: Plugin for Yourls.

Postby acaranta » 30 Mar 2013, 12:13

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.

User avatar
acaranta
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 30 Mar 2013, 10:30

Re: Plugin for Yourls.

Postby acaranta » 30 Mar 2013, 12:19

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 ...

User avatar
HeikoAdams
Bear Rating Master
Bear Rating Master
Posts: 101
Joined: 19 Mar 2013, 00:17

Re: Plugin for Yourls.

Postby HeikoAdams » 30 Mar 2013, 12:28

Okay, my mistake the multiple call problem is fixed in your version. Sorry for that.

User avatar
acaranta
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 30 Mar 2013, 10:30

Re: Plugin for Yourls.

Postby acaranta » 30 Mar 2013, 22:23

No problem glad I fixed it as I thouhgt ;)

User avatar
acaranta
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 30 Mar 2013, 10:30

Re: Plugin for Yourls.

Postby acaranta » 30 Mar 2013, 23:48

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 1409 times

User avatar
acaranta
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 30 Mar 2013, 10:30

Re: Plugin for Yourls.

Postby acaranta » 02 Apr 2013, 19:47

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 ;)

jdelamater99
Bear Rating Master
Bear Rating Master
Posts: 109
Joined: 11 Apr 2013, 17:45

Re: Plugin for Yourls.

Postby jdelamater99 » 11 Apr 2013, 17:48

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


Return to “Themes and plugins”

Who is online

Users browsing this forum: No registered users and 5 guests