Skip to content

Instantly share code, notes, and snippets.

@ishideo
Last active March 7, 2019 06:00
Show Gist options
  • Save ishideo/c4348bfe09348317dff2cfdadde9cfb4 to your computer and use it in GitHub Desktop.
Save ishideo/c4348bfe09348317dff2cfdadde9cfb4 to your computer and use it in GitHub Desktop.
/*
* This Kotlin source file was generated by the Gradle 'init' task.
*/
package HatenaBookmarkFavoriteChecker
import org.jsoup.Jsoup
fun main(args: Array<String>) {
val xml = Jsoup.connect("http://b.hatena.ne.jp/user/bookmark.rss").get() ?: return
val elements = xml.select("item").first()
println(elements.getElementsByTag("dc:date").get(0).text())
}
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Kotlin application project to get you started.
*/
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin on the JVM
id("org.jetbrains.kotlin.jvm").version("1.2.21")
// Apply the application to add support for building a CLI application
id("application")
id("com.github.johnrengelman.shadow") version "5.0.0"
}
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// Use the Kotlin JDK 8 standard library
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// Use the Kotltlin jsoup library
implementation("org.jsoup:jsoup:1.11.3")
// Use the Kotlin test library
testImplementation("org.jetbrains.kotlin:kotlin-test")
// Use the Kotlin JUnit integration
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
}
application {
// Define the main class for the application
mainClassName = "HatenaBookmarkFavoriteChecker.AppKt"
}
tasks.withType<Jar> {
manifest {
attributes(mapOf(
"Main-Class" to "HatenaBookmarkFavoriteChecker.AppKt"
))
}
}
tasks.withType<ShadowJar> {
baseName = "hatebfavcheck"
classifier = ""
version = ""
}
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
org.gradle.daemon=true
// org.gradle.java.home=C:\\JDKPortable
// systemProp.http.proxyHost=
// systemProp.http.proxyPort=
// systemProp.https.proxyHost=
// systemProp.https.proxyPort=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment