Operations with bitlinks.
This script is written as part of the task of the courses Devman.
-
When entering a bitlink into the program, outputs the sum of clicks on it.
-
When entering other links, a bitlink is output.
These instructions will get you a copy of the project up and running on your local machine.
Python 3.6 and later.
To install the software, you need to install the dependency packages from the file: requirements.txt.
Perform the command:
pip3 install -r requirements.txt
- To get the API key. You need to log in to the service link:
Bitly. - In the developer settings menu, select the API and access token.
You need to create a .env file and write all sensitive data into it, like this:
BITLY_ACCESS_TOKEN="272a05d39ec46fdac5be4ac7be45f3f"Enter link: https://dvmn.org
>>> $ python bitlinks.py https://dvmn.org
Вы ввели длинную ссылку!
Bitlink: https://bit.ly/2P4hRWfEnter bitlink: https://bit.ly/2P4hRWf
>>> $ python bitlinks.py https://bit.ly/2P4hRWf
Вы ввели Bitlink!
Сумма кликов Bitlink: 7
Enter links: https://dvmn.org, https://www.google.ru, https://twitter.com
>>> $ python bitlinks.py https://dvmn.org https://www.google.ru https://twitter.com
Вы ввели длинную ссылку!
Bitlink: https://bit.ly/2P4hRWf
Вы ввели длинную ссылку!
Bitlink: https://bit.ly/3BIc8M9
Вы ввели длинную ссылку!
Bitlink: https://bit.ly/2ZIU8UNEnter bitlinks: https://bit.ly/2P4hRWf https://bit.ly/3BIc8M9 https://bit.ly/2ZIU8UN
>>> $ python bitlinks.py https://bit.ly/2P4hRWf https://bit.ly/3BIc8M9 https://bit.ly/2ZIU8UN
Вы ввели Bitlink!
Сумма кликов Bitlink: 7
Вы ввели Bitlink!
Сумма кликов Bitlink: 4
Вы ввели Bitlink!
Сумма кликов Bitlink: 11vlaskinmac - GitHub-vlaskinmac