No description
Find a file
Jabba Laci 53769e0b85 README
2022-08-06 09:29:55 +02:00
.gitignore README 2022-08-06 09:29:55 +02:00
.travis.yml travis added 2018-10-23 18:40:15 +02:00
config.nims bound check added 2018-10-23 19:03:35 +02:00
LICENSE Initial commit 2018-10-23 18:18:31 +02:00
Makefile README 2022-08-06 09:29:55 +02:00
README.md README 2022-08-06 09:29:55 +02:00
TODO.md v0.1.0 2018-10-23 18:33:04 +02:00
urlshortener.nim README 2022-08-06 09:29:55 +02:00
urlshortener.nimble clean up 2018-10-23 18:52:45 +02:00

URL Shortener

A URL shortener cli app. using bit.ly.

Usage

You can pass the long URL as a command-line parameter or you can use the app. in interactive mode if you don't specify any parameters.

$ ./urlshortener http://google.com
http://bit.ly/2CZtpGA
# expanded from shortened URL: http://google.com (matches)
$ ./urlshortener
Long URL: https://google.com
http://bit.ly/2R9zFOR
# expanded from shortened URL: https://google.com (matches)

(In the latter case we used the https protocol, hence the difference.)

Installation

$ nimble install urlshortener

Pre-requisite

For this to work, you need an access token from bit.ly. Don't worry, it's free. After registration you can generate one for yourself. Then, add it as an environment variable called BITLY_ACCESS_TOKEN. For instance, under Linux add the following line to the end of your ~/.bashrc file:

export BITLY_ACCESS_TOKEN="..."

I recommend the Rust version.