urlshortener

A URL shortener cli app. using bit.ly

Pure Nim score 30/100 · tests present · docs generated

Summary

Latest Version Unknown
License MIT
CI Status Passing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install urlshortener
choosenim install urlshortener
git clone https://github.com/jabbalaci/UrlShortener

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
urlshortener - - - - - - -

Source

Repository https://github.com/jabbalaci/UrlShortener
Homepage https://github.com/jabbalaci/UrlShortener
Documentation View Documentation
Registry Source nimble_official

README

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="..."

Related projects

  • I used https://github.com/bitly/bitly-api-python to figure out what API calls to make.

  • I have a C# implementation, which uses the newer API of bit.ly (v4).

  • I have a Rust implementation too, which uses the newer API of bit.ly (v4).

I recommend the Rust version.