The script receives a short link through the Bit-ly API. And also get the number of clicks for links created by the user earlier.
This script can't work without Bit-link access token. To get Bit-link use the following instructions Click here
Copy or clone this repository to your local machine.
Rename .env.sample in to .env.
Replace <Your bitlink token>to your Bit-link token.
Should be something similar to:
BITLINK_TOKEN=23123hoy48124ydqs7dglqs7dgbdoqbwd78
Create environment inside project folder, run command:
python3 -m venv envTo activate environment run command:
source env/bin/activateTo install needed packages run command:
pip install -r requirements.txtRun script.
python3 link_shortener.py YOUR_LINK
#Bitlink created: https://bit.ly/3DCyocPScript answer if Bit-link is already created:
python3 link_shortener.py YOUR_LINK
#Clicks Count: 3