Update to Twitter Tools Supr Links

I pushed out a new verson of Twitter Tools Supr Links a couple of days ago, so I thought I should let you know what it now does. I’ve fixed a few bugs before without pushing the release properly, because I didn’t realise that I had to change the “stable version” in the readme –  got caught up with fixing the problems and forgot to update the information!

First of all, I fixed a problem with authenticating login details – even if you put in a correct username and API key,supr links said they were invalid because when it tried to check the link I was feeding it, the link was invalid, not your details! I’ve fixed some links to the settings section of Su.pr (not called “account”!) and now ‘ve made it possible to use this plugin if you have short URLs on your own domain. Now I don’t use this on jonrogers.co.uk – I like the su.pr name and it’s shortness, but I want to give you the choice. Thanks to Alex for pointing out the bug! The problem is with the way that supr returns the query for a shortened link on your domain. If you own “yourdomain.com” and you want to shorten the link “yourdomain.com/link”, the json return gives a short URL of something like “http://su.pr/yourdomain.com/FdJK” which is invalid, even if you’ve given a valid URL (unlike this example) and if the URL redirection on yourdomain.com is perfectly working. The correct link would be “http://youdomain.com/FdJK” – so why does supr add in it’s own site to make it an invalid link? Oh well, time to fix it!
There were a few options of how to do it. I could look for a link that was too long and replace the “su.pr/” with “” (blank). I also noticed that there was a field called “hash”. When you use su.pr as  do, to make a link like “htpp://su.pr/ASDFg”, the hash is the bit after “su.pr/”. when it’s a link on “yourdomain.com” it becomes “yourdomain.com/FdJK”. So in fact it’s easiest to just add “http://” to the start of the hash if it’s longer than 6 characters and use that instead. It seems that su.pr are a little lazy in the way they make the links for your own domain and just add “http://su.pr/” to the start of the hash whatever the situation. I am sure that this workaround will be unnecessary when they sort it out for developers, but as for now, it works properly for you!

The update should have already come automatically, but you can get it by searching for “supr” in the plugins section of WordPress admin or by going to Supr Links on the WordPress Plugins site.