Table of Contents
shorty Plugin
Compatible with DokuWiki
Binky,
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
This plugin automatically generates a 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 Extension Manager. Refer to Plugins on how to install plugins manually.
Dependencies
cURL Extension
Important
It is mandatory that you have installed the 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 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 | 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
- …