How to Make YOURLS.org Work in Tweetbot

tweetbotApi_4

We are big fans of Tweetbot here at 2FatDads, ever since Twitter started to tear all of the goodness out of Tweetie, we jumped ship and started toying around with other clients until we finally discovered Tweetbot.

However one of the big key tools that Twitter striped out of Tweetie that we really liked was the Custom URL Shortner service. We use YOURLS here and have always found it important that we be able to tell our readers and followers that the link we are using has been 2FatDads approved. So with the release of Tweetbot 2.0, we noticed that Custom API Endpoints where available and that we could, once again, use our own YOURLS server to to shorten links.

Services

  • URL Shortening via Twitter, bit.ly Pro, CloudApp, Custom API Endpoints

However trying to find out how to do it was not very easy. So lets walk it though and hopefully help out a few others along the way.

First you will need to log into your YOURLS admin page and recuperate your secret token and the structure for the “Secure passwordless API call” it will a little like this:

http://SITE/yourls-api.php?signature=SECRETTOKEN&format=simple&action=shorturl&url=%@

Where SITE is your domain name and folder structure leading up to the yourls-api.php file. for example ours in http://2fatdads.com/u/

Next SECRETTOKEN is the site specific code that appears on the YOURLS tool page.

And finally %@ is the specific call to the URL being handed over for shortening.

And with that, any link you share via Tweetbot will be shortened using your own YOURLS server and not t.co or bit.ly.

via Tweetbot — Tapbots.

[UPDATE] This has been verified to work with TweetBot 3 which is iOS 7 ready.

SHARE THIS POST

  • Facebook
  • Twitter
  • Reddit

14 Comments on "How to Make YOURLS.org Work in Tweetbot"

  1. Lizzle May 7, 2012 at 2:43 pm -

    Thanks for the helpful instructions. I’ve just set up my own YOURLS server and followed these instructions to the letter but whenever I try to post a tweet with a link Tweetbot gives a messages saying the link couldn’t be shortened. Do you have any suggestions please? Everything on the server seems to be working fine and I’m using a Google Chrome extension successfully to automatically generate custom urls.

  2. Johnny Canuck May 7, 2012 at 2:50 pm -

    This is actually a recent problem that the YOURLS folks had to do to make their version compatible with Twitter’s 3rd party app policy which is what you build when you use your YOURLS profile to connect to Twitter. The plugin developer actually mentions to simply disable the auto-Tweet and install the Simple Twitter Connect plugin by Otto @ WP: http://ottopress.com/wordpress-plugins/simple-twitter-connect/ which actually behaves the way that the previous YOURLS plugin did. (Sorry if this sounds a little confusing, Otto’s site explains it all very well.)

  3. GeekChunks September 28, 2012 at 11:06 am -

    Thank you, thank you, thank you. I’ve been wanting to do this for some time now.

  4. Amber Hewitt October 5, 2012 at 4:14 pm -

    Thanks so much for the information! I downloaded Netbot today and realized I could use my YOURLS for the shortened urls. Google the problem and found your article!

  5. Johnny Canuck October 5, 2012 at 5:53 pm -

    Awesome, glad it helped!

  6. Des Paroz January 26, 2013 at 4:54 am -

    Hi

    Many thanks for this. A great solution.

    Works great for new shortened URLs, but if using one for which a custom URL has already been done, it seems to make a new one.

    Any tips on this?

    Cheers

    Des

  7. Johnny Canuck January 27, 2013 at 12:40 pm -

    The YOURLS service has no way of knowing whether the URL you are providing it is shortened or the original one. Therefore when called it simply creates a new one. This is by design, too many lookups could possibly hang the script and you have the extra benefit that your twitter followers will see your YOURLS link and recognise it as an approved link since it’s now branded with our domain.

  8. Des Paroz January 28, 2013 at 7:50 pm -

    Thanks for replying. Shame this feature is missing, as I’d like to be able to have one consistent view of stats, and a simple message for my readers.

    But your explanation makes sense and appreciate the insight.

  9. Steven February 19, 2013 at 10:51 am -

    Great instructions, worked perfectly first time. Thanks guys!

  10. Johnny Canuck February 19, 2013 at 10:53 am -

    Your welcome!

  11. Aristid Chang March 22, 2013 at 5:58 pm -

    Thank you guys! This was of great help.

  12. Dave April 24, 2013 at 3:13 pm -

    I set up my Tweetbot this way but for some reason URLs are not shortened. Any thoughts?

    Thanks

  13. Chris April 29, 2013 at 2:26 pm -

    Just wanted to say thanks! This is fantastic, you’ve saved me a lot of work. Oh, and when I tweeted using a long URL that was already in YOURLS, it detected that and returned the existing URL rather than creating a new one. So that’s wonderful.

    Again, thanks for the post!

    Chris