Skip to content

gennadis/api-bitly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Just another URL shortener CLI tool

This project is a simple command line tool for shortening URLs via Bitly service.

Features

  • Shorten URL via Bitly
  • Get click counts of shortened URL

Installation notes

  1. Clone project
git clone https://github.com/gennadis/api-bitly.git
cd api-bitly
  1. Create virtual environment
python3 -m venv env
source env/bin/activate
  1. Install requirements
pip install -r requirements.txt
  1. Create .env file and place your Bitly Token in it
BITLY_TOKEN=place_your_token_here
  1. Run
python main.py http://example.com

Examples

Lets 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/python

Voila! You now have a Bitlink to share!

Bitlink: bit.ly/3qWSato

Or 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/3qWSato

And the answer is:

Click counts: 7

About

Devman web api lesson 2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages