Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simplest possible python link-shortener

Tags:

url

python-3.x

I want to make the simplest possible Url shortener in Python.

like this:

link = input("Type your link:")

#print output

I can use for this Python libraries if needed.

I want the code to be as simple as possible - 10 lines maximum.

The code must be efficient.

like image 627
crackme.exe Avatar asked Apr 06 '26 21:04

crackme.exe


1 Answers

The simplest possible Url shortener in Python:

import pyshorteners

#link = 'https://yourwebsitehere.com/'

link = input("Type your link")

print(pyshorteners.Shortener().clckru.short(link))

#output: https://clck.ru/*****
like image 68
konrados Avatar answered May 01 '26 06:05

konrados