Initial commit.
This commit is contained in:
commit
60c449feed
37 changed files with 1658 additions and 0 deletions
20
examples/src/main/java/com/example/IsgdSample.java
Normal file
20
examples/src/main/java/com/example/IsgdSample.java
Normal file
|
@ -0,0 +1,20 @@
|
|||
package com.example;
|
||||
|
||||
import net.thauvin.erik.isgd.Isgd;
|
||||
|
||||
public final class IsgdSample {
|
||||
public static void main(final String[] args) {
|
||||
if (args.length > 0) {
|
||||
for (final String arg : args) {
|
||||
if (arg.contains("is.gd")) {
|
||||
System.out.println(arg + " <-- " + Isgd.lookup(arg));
|
||||
} else {
|
||||
System.out.println(arg + " --> " + Isgd.shorten(arg));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
System.err.println("Try specifying one or more URLs as arguments.");
|
||||
}
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
18
examples/src/main/kotlin/com/example/IsgdExample.kt
Normal file
18
examples/src/main/kotlin/com/example/IsgdExample.kt
Normal file
|
@ -0,0 +1,18 @@
|
|||
package com.example
|
||||
|
||||
import net.thauvin.erik.isgd.Isgd
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
if (args.isNotEmpty()) {
|
||||
args.forEach {
|
||||
if (it.contains("is.gd"))
|
||||
println(it + " <-- " + Isgd.lookup(it))
|
||||
else
|
||||
println(it + " --> " + Isgd.shorten(it))
|
||||
}
|
||||
} else {
|
||||
println("Try specifying one or more URLs as arguments.")
|
||||
}
|
||||
exitProcess(0)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue