Interactive command to replace github URL at point with a shortened one using git.io.
Gets the URL at current cursor position, makes a request to git.io to get the shortened URL and replaces the original url with the shortened one.
Note: This package uses git.io which works only for github URLs.
-
MELPA: Package is available for install in MELPA -
git-io
-
Manual: Place the
git-io.el
file in your loadpath and require it:(require 'git-io)
.
Once the package is loaded, an interactive command git-io-shorten
is available.
Point on the github url and invoke git-io-shorten
command: M-x git-io-shorten
.
Optionally, bind a key for quick usage:
(global-set-key (kbd "C-x \\") 'git-io-shorten)
See it in action:
- Handle the invalid url error better - give proper message.
- For some strange reason git.io does not work with
http://
urls check forhttp://
urls and convert them tohttps://
before making request. - Write some tests.