Updated examples.

This commit is contained in:
Erik C. Thauvin 2020-03-03 15:51:00 -08:00
parent 4ca3773fe9
commit e3f3ae2b2d
3 changed files with 2 additions and 4 deletions

View file

@ -3,13 +3,12 @@ package com.example
import net.thauvin.erik.bitly.Bitly
import net.thauvin.erik.bitly.Methods
import net.thauvin.erik.bitly.Utils.Companion.toEndPoint
import org.json.JSONObject
import kotlin.system.exitProcess
fun main() {
val bitly = Bitly(/* "YOUR_API_ACCESS_TOKEN from https://bitly.is/accesstoken" */)
val json = JSONObject(bitly.call("/bitlinks/bit.ly/380ojFd".toEndPoint(), method = Methods.GET))
val json = bitly.call("/bitlinks/bit.ly/380ojFd".toEndPoint(), method = Methods.GET).toJson()
println("Bitlink is titled : " + json.getString("title"))
println("Bitlink created by: " + json.getString("created_by"))