A url-shortner built using flask and Bitly api. It has following dependencies:
- Flask - Core dependency
- SQLAlchemy - For working with database
- requests - For sending GET and POST request
- PyQRCode - For generating QR code of URL
For using bitly api go to Bitly website and get a free account to get authentication key and group id. Use these credentials in the applications.
To find out guid
for your account. Make a GET request to
https://api-ssl.bitly.com/v4/groups
you can use Postman, Curl, Node or Python request module.
While making request pass your Authorization token to header. In curl you can do this
curl \
-H 'Authorization: Bearer {TOKEN}' \
-X GET \
https://api-ssl.bitly.com/v4/groups
This returns a json object containing guid
.
For more info
- Clone the repo:
git clone https://github.com/zootedb0t/url_shortner && cd url_shortner
- Create a python virtual environment:
python -m venv venv
- Activate virtual environment:
source venv/bin/activate
- Install required modules:
pip install -r requirements.txt
- Run app:
flask run