====== shorty Plugin ====== ---- plugin ---- description: Generates a short url to the current page using a url shortening service. author : Fernando Ribeiro email : pinguim.ribeiro@gmail.com type : syntax, helper lastupdate : 2014-03-11 compatible : Binky, depends : conflicts : similar : tags : links, shorturls downloadurl: https://github.com/fa-ribeiro/dokuwiki-plugin-shorty/zipball/master bugtracker : https://github.com/fa-ribeiro/dokuwiki-plugin-shorty/issues sourcerepo : https://github.com/fa-ribeiro/dokuwiki-plugin-shorty/ donationurl: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6RNWKBMMM2FUA ---- This plugin automatically generates a [[wp>Short_URL]] link to the current page. Currently Shorty supports the following url shortening services: * Bit.ly * Bitly.com * j.mp * tinyURL * yourls ===== Download ===== Download the plugin using the plugin manager or manually from the download link above. ===== Installation ===== Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. ===== Dependencies ===== ==== cURL Extension ==== :!: Important :!:\\ It is **mandatory** that you have installed the [[phpfn>curl|cURL Extension]] for PHP. You can check if the extension is installed using the following code: if ( function_exists('curl_init') ) { echo 'cURL is installed'; } else { echo 'cURL is NOT installed'; } ===== Configuration ===== The plugin provides different url shortening services: * Bit.ly * Bitly.com * j.mp * tinyURL * yourls Select the default service in the [[plugin:config|config manager]]. Shorty supports a few authorization protocols on services providing such functionality. Depending on the service you plan to use, it may be necessary to register and get an access token. ^ service ^ Authorization ^ more info ^ | Bit.ly \\ bitly.com \\ j.mp | [[wp>OAuth]] token | https://bitly.com/a/oauth_apps | | tinyURL | none | | | yourls | Signature token | https://github.com/YOURLS/YOURLS/wiki/PasswordlessAPI | ===== Usage ===== Basic syntax usage: ~~shorty [service]~~ where ''[service]'' can be one of the following options: ^ option ^ service ^ output example ^ | '' '' | uses the default service | http://bit.ly/17dfkP5 | | ''default'' | uses the default service | http://bit.ly/17dfkP5 | | ''bit.ly'' | uses the bit.ly service | http://bit.ly/17dfkP5 | | ''bitly.com'' | uses the bitly.com service | http://bitly.com/17dfkP5 | | ''j.mp'' | uses the j.mp service | http://j.mp/17dfkP5 | | ''tinyurl'' | uses the tinyurl.com service | http://tinyurl.com/9xp3n8h | | ''yourls'' | uses the yourls self hosted service | http://yourls.org/d1 | ==== Examples ==== Using the default service: The short link to this page is: ~~shorty~~. Result: The short link to this page is: http://tinyurl.com/qalfp2p. Using a specific service: The short link to this page is: ~~shorty bit.ly~~. Result: The short link to this page is: http://bit.ly/Okr3Vi. ===== Development ===== ==== Change Log ==== * 2014-03-19 * add yourls service, thanks to BlackRocket! * Set default service to tinyurl in order to work out of the box * 2014-03-14 * Initial version ==== Known Bugs and Issues ==== * please let me know :-) ==== ToDo/Wish List ==== * To add support for more services: * goo.gl * ... ===== Discussion =====