Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 664 Bytes

File metadata and controls

28 lines (17 loc) · 664 Bytes

Ln-K - A minimalist link shortner

A simple no-frills link shortner, made using the django web framework. Visit Ln-k.cf to test it out now !

API

In order to generate a short url, send a POST request to https://ln-k.cf/api with the url parameter.

CURL

$ curl "https://ln-k.cf/api/" -d "url=https://google.com"

{"status_code": 200, "shorturl": "https://ln-k.cf/bndrc", "message": "Short URL Created Successfully !"}

Python

import requests

longurl = "https://google.com"
r = requests.post("http://ln-k.cf/api/", data={"url":longurl})

shorturl = r.json()['shorturl']
print(shorturl)