This project is a simple command line tool for shortening URLs via Bitly service.
- Shorten URL via Bitly
- Get click counts of shortened URL
- Clone project
git clone https://github.com/gennadis/api-bitly.git
cd api-bitly- Create virtual environment
python3 -m venv env
source env/bin/activate- Install requirements
pip install -r requirements.txt- Create .env file and place your Bitly Token in it
BITLY_TOKEN=place_your_token_here- Run
python main.py http://example.comLets say you want to shorten this link: https://www.reddit.com/r/python
So you have to run main.py with this URL as an argument.
python main.py https://www.reddit.com/r/pythonVoila! You now have a Bitlink to share!
Bitlink: bit.ly/3qWSatoOr maybe you want to get some stats of Biltlink you've got there. Just run main.py with your Bitlink as an argument.
python main.py bit.ly/3qWSatoAnd the answer is:
Click counts: 7