linkshrink: A url shortner
- naive implementation stores shortened urls in an in-memory dictionary
- actually works.
gh repo clone chrispydizzle/lnkshrnk
cd lnkshrnk
pip install -r requirements.txt
flask run
curl http://localhost:5000/shrink -d '{ "url": "https://dogeplanet.com" }' -H 'Content-Type: application/json'
{
"url": "http://localhost:5000/go/5fd5085c"
}
Visiting the shrunken url will redirect you to the original url. But if you just want the original url
curl http://localhost:5000/unshrink -d '{ "url": "http://localhost:5000/go/5fd5085c" }' -H 'Content-Type: application/json'
{
"url": "https://dogeplanet.com"
}