Added update config builder example.
This commit is contained in:
parent
31f5aac584
commit
c2e22f84b8
1 changed files with 24 additions and 4 deletions
28
README.md
28
README.md
|
@ -1,10 +1,16 @@
|
||||||
[](https://opensource.org/licenses/BSD-3-Clause) [](https://github.com/ethauvin/bitly-shorten/releases/latest) [](https://search.maven.org/search?q=g:%22net.thauvin.erik%22%20AND%20a:%22bitly-shorten%22)
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
||||||
|
[](https://kotlinlang.org/)
|
||||||
|
[](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/bitly-shorten/)
|
||||||
|
[](https://github.com/ethauvin/bitly-shorten/releases/latest)
|
||||||
|
[](https://search.maven.org/search?q=g:%22net.thauvin.erik%22%20AND%20a:%22bitly-shorten%22)
|
||||||
|
|
||||||
[](https://sonarcloud.io/dashboard?id=ethauvin_bitly-shorten) [](https://github.com/ethauvin/bitly-shorten/actions/workflows/gradle.yml) [](https://circleci.com/gh/ethauvin/bitly-shorten/tree/master)
|
[](https://sonarcloud.io/dashboard?id=ethauvin_bitly-shorten)
|
||||||
|
[](https://github.com/ethauvin/bitly-shorten/actions/workflows/gradle.yml)
|
||||||
|
[](https://circleci.com/gh/ethauvin/bitly-shorten/tree/master)
|
||||||
|
|
||||||
# [Bitly](https://dev.bitly.com/v4/) Shortener for Kotlin/Java/Android
|
# [Bitly](https://dev.bitly.com/v4/) Shortener for Kotlin, Java & Android
|
||||||
|
|
||||||
A simple implementation of the link shortening (Bitlinks) abilities of the [Bitly v4 API](https://dev.bitly.com/api-reference).
|
A simple implementation of the [Bitly](https://bit.ly/) link shortening (Bitlinks) [API v4](https://dev.bitly.com/api-reference).
|
||||||
|
|
||||||
## Examples (TL;DR)
|
## Examples (TL;DR)
|
||||||
|
|
||||||
|
@ -53,6 +59,7 @@ To use with [Gradle](https://gradle.org/), include the following dependency in y
|
||||||
```gradle
|
```gradle
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") } // only needed for SNAPSHOT
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -62,6 +69,19 @@ dependencies {
|
||||||
|
|
||||||
Instructions for using with Maven, Ivy, etc. can be found on [Maven Central](https://search.maven.org/artifact/net.thauvin.erik/bitly-shorten/0.9.3/jar).
|
Instructions for using with Maven, Ivy, etc. can be found on [Maven Central](https://search.maven.org/artifact/net.thauvin.erik/bitly-shorten/0.9.3/jar).
|
||||||
|
|
||||||
|
## Java
|
||||||
|
|
||||||
|
To make it easier to use the library with Java, an update configuration builder is available:
|
||||||
|
|
||||||
|
```java
|
||||||
|
var config = new UpdateConfig.Builder()
|
||||||
|
.bitlink("https://bit.ly/380ojFd")
|
||||||
|
.title("Erik's Weblog")
|
||||||
|
.tags(new String[] { "blog", "weblog"})
|
||||||
|
.build();
|
||||||
|
|
||||||
|
bitly.bitlinks().update(config);
|
||||||
|
```
|
||||||
### JSON
|
### JSON
|
||||||
|
|
||||||
All implemented API calls can return the full JSON responses:
|
All implemented API calls can return the full JSON responses:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue