This script has two main features. Firslty, it can shorten links with Bitly.com and copy them to your clipboard. Secondly, it can provide you with the statistics for your short links.
This script will not execute unless you have a Bitly token. You can get a token in your profile settings on Bitly.com. For more information, please read section Authorization of Bitly API Documentation.
After you get the token, create a file with the name .env
in the same directory with the script. Paste your token in the file:
BITLY_TOKEN = token
where token is your Bitly token.
Python3 should be already installed.
Then use pip
(or pip3
, if there is a conflict with Python2) to install dependencies:
pip install -r requirements.txt
python3 main.py url
where url is the link you want the script to use.
The code is written for educational purposes on online-course for web-developers dvmn.org.