Skip to content

Commit

Permalink
Corrected the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Taralas209 committed Mar 24, 2023
1 parent 685e001 commit 08b74ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ To use the script, open a terminal or command prompt and navigate to the directo

To shorten a URL, run the following command:

`python main.py --url_link <your_long_url>`
`python main.py --link <your_link_to_shorten>`

Replace `<your_long_url>` with the URL you want to shorten.
Replace `<your_link_to_shorten>` with the URL you want to shorten.

<br>

To check the click count for an existing Bitly link, run the same command with the Bitly link:

`python main.py --url_link <your_bitly_link>`
`python main.py --link <your_bitly_link>`

Replace `<your_bitly_link>` with the Bitly link you want to check the click count for.

Expand Down
4 changes: 2 additions & 2 deletions RU_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@

Чтобы сократить URL, выполните следующую команду:

`python main.py --url_link <your_long_url>`
`python main.py --link <ваша_длинная_ссылка>`

Замените `<ваша_длинная_ссылка>` на ссылку, которую вы хотите сократить.

<br>
Чтобы проверить количество кликов по существующей ссылке Bitly, выполните ту же команду с ссылкой Bitly:

`python main.py --url_link <ваша_bitly_ссылка>`
`python main.py --link <ваша_bitly_ссылка>`

Замените `<ваша_bitly_ссылка>` на ссылку Bitly, для которой вы хотите проверить количество кликов.

Expand Down
7 changes: 4 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,16 @@ def create_parser():
parser = argparse.ArgumentParser()
parser.add_argument('--link', type=str, help='Введите ссылку', default='test.test')
parser.add_argument('--link_title', type=str, help='Введите название ссылки', default='another bitlink')
return parser.parse_args()
return parser


def main():
load_dotenv()
access_token = os.environ['BITLY_ACCESS_TOKEN']
parser = create_parser()
link = parser.link
link_title = parser.link_title
args = parser.parse_args()
link = args.link
link_title = args.link_title
try:
if is_bitlink(link, access_token):
clicks_count = count_link_clicks(link, access_token)
Expand Down

0 comments on commit 08b74ae

Please sign in to comment.