isgd-shorten/README.md

2.1 KiB

License (3-Clause BSD)
Known Vulnerabilities Quality Gate Status Build Status CircleCI

is.gd Shortener for Kotlin/Java.

A simple implementation of the is.gd API.

Examples (TL;DR)

import net.thauvin.erik.isgd.Isgd

...

Isgd.shorten("https://www.example.com/") // returns https://is.gd/Pt2sET
Isgd.lookup("https://is.gd/Pt2sET") // returns https://www.example.com

JSON or XML

The is.gd API can return data in plain text (default), JSON or XML.

Isgd.shorten("https://www.example.com/", format = Format.JSON)
{
    "shorturl": "https://is.gd/Pt2sET"
}

Parameters

All of the is.gd API parameters are supported:

Isgd.shorten(url = url, shorturl="foobar", callback = "test", logstats = true, format = Format.JSON)
{
    "shorturl": "https://is.gd/foobar"
}

v.gd

Additionally, link can be shorten using v.gd by setting the isVgd flag:

Isgd.shorten("https://www.example.com/", isVgd = true) // returns https://v.gd/2z2ncj