Fixed examples and docs.
This commit is contained in:
parent
8138a23bc5
commit
0f08c131c6
3 changed files with 11 additions and 11 deletions
16
README.md
16
README.md
|
@ -1,7 +1,7 @@
|
||||||
[](http://opensource.org/licenses/BSD-3-Clause)
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
||||||
[](https://snyk.io/test/github/ethauvin/bitly-shorten?targetFile=pom.xml) [](https://sonarcloud.io/dashboard?id=ethauvin_bitly-shorten) [](https://travis-ci.org/ethauvin/bitly-shorten) [](https://circleci.com/gh/ethauvin/bitly-shorten/tree/master)
|
[](https://snyk.io/test/github/ethauvin/bitly-shorten?targetFile=pom.xml) [](https://sonarcloud.io/dashboard?id=ethauvin_bitly-shorten) [](https://travis-ci.com/ethauvin/bitly-shorten) [](https://circleci.com/gh/ethauvin/bitly-shorten/tree/master)
|
||||||
|
|
||||||
# [Bitly](https://dev.bitly.com/v4/) Shortener for Kotlin/Java.
|
# [Bitly](https://dev.bitly.com/v4/) Shortener for Kotlin/Java
|
||||||
|
|
||||||
A simple implementation of the link shortening ([bitlinks](https://dev.bitly.com/v4/#tag/Bitlinks)) abilities of the [Bitly v4 API](https://dev.bitly.com/v4).
|
A simple implementation of the link shortening ([bitlinks](https://dev.bitly.com/v4/#tag/Bitlinks)) abilities of the [Bitly v4 API](https://dev.bitly.com/v4).
|
||||||
|
|
||||||
|
@ -14,16 +14,16 @@ val bitly = Bitly(/* "YOUR_API_ACCESS_TOKEN from https://bitly.is/accesstoken" *
|
||||||
bitly.bitlinks().shorten("https://erik.thauvin.net/blog")
|
bitly.bitlinks().shorten("https://erik.thauvin.net/blog")
|
||||||
|
|
||||||
// Expand
|
// Expand
|
||||||
bitly.bitlinks().expand("http://bit.ly/380ojFd")
|
bitly.bitlinks().expand("https://bit.ly/380ojFd")
|
||||||
|
|
||||||
// Clicks Summary
|
// Clicks Summary
|
||||||
bitly.bitlinks().clicks("http://bit.ly/380ojFd")
|
bitly.bitlinks().clicks("https://bit.ly/380ojFd")
|
||||||
|
|
||||||
// Create a bitlink
|
// Create a bitlink
|
||||||
bitly.bitlinks().create(title = "Erik's Weblog", long_url = "http://erik.thauvin.net/blog/")
|
bitly.bitlinks().create(title = "Erik's Weblog", long_url = "https://erik.thauvin.net/blog/")
|
||||||
|
|
||||||
// Update a bitlink
|
// Update a bitlink
|
||||||
bitly.bitlinks().update("http://bit.ly/380ojFd", title="Erik's Weblog", tags = arrayOf("blog", "weblog"))
|
bitly.bitlinks().update("https://bit.ly/380ojFd", title="Erik's Weblog", tags = arrayOf("blog", "weblog"))
|
||||||
```
|
```
|
||||||
|
|
||||||
- View [Kotlin](https://github.com/ethauvin/bitly-shorten/blob/master/examples/src/main/kotlin/com/example/BitlyExample.kt) or [Java](https://github.com/ethauvin/bitly-shorten/blob/master/examples/src/main/java/com/example/BitlySample.java) Examples.
|
- View [Kotlin](https://github.com/ethauvin/bitly-shorten/blob/master/examples/src/main/kotlin/com/example/BitlyExample.kt) or [Java](https://github.com/ethauvin/bitly-shorten/blob/master/examples/src/main/java/com/example/BitlySample.java) Examples.
|
||||||
|
@ -55,7 +55,7 @@ bitly.bitlinks().shorten("https://www.erik.thauvin.net/blog", toJson = true)
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"created_at": "2020-02-26T06:50:08+0000",
|
"created_at": "2020-02-26T06:50:08+0000",
|
||||||
"link": "http://bit.ly/380ojFd",
|
"link": "https://bit.ly/380ojFd",
|
||||||
"id": "bit.ly/380ojFd",
|
"id": "bit.ly/380ojFd",
|
||||||
"long_url": "https://erik.thauvin.net/blog"
|
"long_url": "https://erik.thauvin.net/blog"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,8 @@ package com.example;
|
||||||
|
|
||||||
import net.thauvin.erik.bitly.Bitly;
|
import net.thauvin.erik.bitly.Bitly;
|
||||||
|
|
||||||
public class BitlySample {
|
public final class BitlySample {
|
||||||
public static void main(String[] args) {
|
public static void main(final String[] args) {
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
final Bitly bitly = new Bitly(/* "YOUR_API_TOKEN from https://bitly.is/accesstoken" */);
|
final Bitly bitly = new Bitly(/* "YOUR_API_TOKEN from https://bitly.is/accesstoken" */);
|
||||||
for (final String arg : args) {
|
for (final String arg : args) {
|
||||||
|
|
|
@ -52,7 +52,7 @@ class BitlyTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private val longUrl = "https://erik.thauvin.net/blog"
|
private val longUrl = "https://erik.thauvin.net/blog"
|
||||||
private val shortUrl = "http://bit.ly/380ojFd"
|
private val shortUrl = "https://bit.ly/380ojFd"
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
fun before() {
|
fun before() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue