This EMACS library implements convenient functions to shorten an url with Yourls API, Your Own URL Shortener.
It provides two commands to shorten, yourls-at-point and yourls-region. The first function will scan the point and pull the url to shorten. The other will do the same for a selected region.
There is also a command to expand the shortened url at point yourls-get-point. This command will just look into the database and retreive the long url for the shortened url you have at the point.
You can also make a custom url with the function yourls-make-custom that will ask what keyword to use in making the shortened url.
To used it you have to define two variables, yourls-api-endpoint and yourls-api-signature. Your can learn about them at http://yourls.org/#API.
You can find your api-signature (usually 10 random letters and numbers) at your installation. (substitute <your installation> with the domain where you installed it).
http://<your installation>/admin/tools.php
You can install this extension using el-get :
(el-get-bundle yourls
:url "https://github.com/jsrjenkins/yourls.el.git"
:features yourls)
(setq yourls-api-endpoint "http://<the location of yourls>/yourls-api.php")
(setq yourls-api-signature "<your private signature>")
Similarly you can just add yourls.el to you emacs loading path.
This is heavily modified from the original extension by Yasushi SHOJI. His version is no longer working and apparently no longer maitained. For this reason we publish here this entirely new version which doesn’t require any package other than the yourls.el file.