An interactive URL shortener CLI app. for bit.ly. Implemented in C#, using bit.ly's API v4.
It was tested under Linux and Windows.
$ ./UrlShortener
Long URL: https://google.com
https://bit.ly/2R9zFOR
# expanded from shortened URL: https://google.com (matches)Compile and run:
$ dotnet runMake a framework-dependent deployment:
$ dotnet publish -o dist -c ReleaseFor 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 used pyshorteners to figure out how to call bit.ly's API v4.
-
I have a Nim implementation but that one uses an older API of bit.ly (v3).
-
I have a Rust implementation too, which uses the newer API of bit.ly (v4).
I recommend the Rust version.