A script to shorten a long URL and copy the shortened link to the clipboard.
-
Install pyshorteners.
$ pip3 install pyshorteners
-
Install pyperclip.
$ pip3 install pyperclip
First, add the following line to your .bashrc
file:
source ~/<path to this folder>/.url_command.sh
Then, you will be able to use the surl
command : surl <URL>
will shorten the URL
and copy the result to the clipboard.