Implemented Pinboard.in integration.

This commit is contained in:
Erik C. Thauvin 2017-05-17 17:38:14 -07:00
parent 16953c8f98
commit 73dbd6c0d8
12 changed files with 214 additions and 157 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="mobibot" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.version="0.7.1-beta+018" type="JAVA_MODULE" version="4"> <module external.linked.project.id="mobibot" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.version="0.7.1-beta+020" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/../../build/classes/main" /> <output url="file://$MODULE_DIR$/../../build/classes/main" />
<output-test url="file://$MODULE_DIR$/../../build/classes/test" /> <output-test url="file://$MODULE_DIR$/../../build/classes/test" />
@ -18,62 +18,40 @@
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: log4j:log4j:1.2.17" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: log4j:log4j:1.2.17" level="project" />
<orderEntry type="module-library" scope="TEST"> <orderEntry type="library" scope="TEST" name="Gradle: com.squareup.okio:okio:1.13.0" level="project" />
<library name="Gradle: owm-japis-2.5.0.5"> <orderEntry type="library" scope="TEST" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
<CLASSES> <orderEntry type="library" scope="TEST" name="Gradle: com.squareup.okhttp3:okhttp:3.8.0" level="project" />
<root url="jar://$MODULE_DIR$/../../lib/owm-japis-2.5.0.5.jar!/" /> <orderEntry type="library" scope="TEST" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3" level="project" />
</CLASSES> <orderEntry type="library" scope="TEST" name="Gradle: net.thauvin.erik:pinboard-poster:0.9.0" level="project" />
<JAVADOC /> <orderEntry type="library" scope="RUNTIME" name="Gradle: com.squareup.okio:okio:1.13.0" level="project" />
<SOURCES /> <orderEntry type="library" scope="RUNTIME" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
</library> <orderEntry type="library" scope="RUNTIME" name="Gradle: com.squareup.okhttp3:okhttp:3.8.0" level="project" />
</orderEntry> <orderEntry type="library" scope="RUNTIME" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: net.thauvin.erik:pinboard-poster:0.9.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.jdom:jdom2:2.0.6" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: com.squareup.okio:okio:1.13.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.rometools:rome-utils:1.7.1" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: org.jetbrains:annotations:13.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: net.sf.delicious-java:delicious:1.14" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: com.squareup.okhttp3:okhttp:3.8.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.twitter4j:twitter4j-core:4.0.6" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: net.objecthunter:exp4j:0.4.8" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: net.thauvin.erik:pinboard-poster:0.9.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.ostermiller:utils:1.07.00" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: pircbot:pircbot:1.5.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.json:json:20160810" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.slf4j:slf4j-log4j12:1.7.25" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: commons-logging:commons-logging:1.2" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.rometools:rome:1.7.1" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: commons-net:commons-net:3.6" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.jsoup:jsoup:1.10.2" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: commons-cli:commons-cli:1.4" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: oro:oro:2.0.8" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: commons-httpclient:commons-httpclient:3.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: commons-httpclient:commons-httpclient:3.1" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: oro:oro:2.0.8" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: commons-cli:commons-cli:1.4" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: org.jsoup:jsoup:1.10.2" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: commons-net:commons-net:3.6" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: com.rometools:rome:1.7.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: commons-logging:commons-logging:1.2" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: org.slf4j:slf4j-log4j12:1.7.25" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: commons-codec:commons-codec:1.10" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: org.json:json:20160810" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: pircbot:pircbot:1.5.0" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: org.ostermiller:utils:1.07.00" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: log4j:log4j:1.2.17" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: net.objecthunter:exp4j:0.4.8" level="project" />
<orderEntry type="module-library" scope="RUNTIME"> <orderEntry type="library" scope="PROVIDED" name="Gradle: org.twitter4j:twitter4j-core:4.0.6" level="project" />
<library name="Gradle: owm-japis-2.5.0.5"> <orderEntry type="library" scope="PROVIDED" name="Gradle: net.thauvin.erik:semver:1.0.0" level="project" />
<CLASSES> <orderEntry type="library" scope="PROVIDED" name="Gradle: com.rometools:rome-utils:1.7.1" level="project" />
<root url="jar://$MODULE_DIR$/../../lib/owm-japis-2.5.0.5.jar!/" /> <orderEntry type="library" scope="PROVIDED" name="Gradle: org.jdom:jdom2:2.0.6" level="project" />
</CLASSES> <orderEntry type="library" scope="PROVIDED" name="Gradle: com.github.spullara.mustache.java:compiler:0.9.4" level="project" />
<JAVADOC /> <orderEntry type="library" scope="PROVIDED" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.jdom:jdom2:2.0.6" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: com.rometools:rome-utils:1.7.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: net.sf.delicious-java:delicious:1.14" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.twitter4j:twitter4j-core:4.0.6" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: net.objecthunter:exp4j:0.4.8" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.ostermiller:utils:1.07.00" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.json:json:20160810" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.slf4j:slf4j-log4j12:1.7.25" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: com.rometools:rome:1.7.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.jsoup:jsoup:1.10.2" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: oro:oro:2.0.8" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: commons-httpclient:commons-httpclient:3.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: commons-cli:commons-cli:1.4" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: commons-net:commons-net:3.6" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: commons-logging:commons-logging:1.2" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: pircbot:pircbot:1.5.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: log4j:log4j:1.2.17" level="project" />
<orderEntry type="module-library" scope="PROVIDED"> <orderEntry type="module-library" scope="PROVIDED">
<library name="Gradle: owm-japis-2.5.0.5"> <library name="Gradle: owm-japis-2.5.0.5">
<CLASSES> <CLASSES>
@ -83,25 +61,59 @@
<SOURCES /> <SOURCES />
</library> </library>
</orderEntry> </orderEntry>
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: log4j:log4j:1.2.17" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.github.spullara.mustache.java:compiler:0.9.4" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: pircbot:pircbot:1.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jdom:jdom2:2.0.6" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.rometools:rome-utils:1.7.1" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: commons-logging:commons-logging:1.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.thauvin.erik:semver:1.0.0" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: commons-net:commons-net:3.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.sf.delicious-java:delicious:1.14" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: commons-cli:commons-cli:1.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.twitter4j:twitter4j-core:4.0.6" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: commons-httpclient:commons-httpclient:3.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.objecthunter:exp4j:0.4.8" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: oro:oro:2.0.8" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.ostermiller:utils:1.07.00" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: org.jsoup:jsoup:1.10.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.json:json:20160810" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: com.rometools:rome:1.7.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.slf4j:slf4j-log4j12:1.7.25" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: org.slf4j:slf4j-log4j12:1.7.25" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.rometools:rome:1.7.1" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: org.json:json:20160810" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jsoup:jsoup:1.10.2" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: org.ostermiller:utils:1.07.00" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: oro:oro:2.0.8" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: net.objecthunter:exp4j:0.4.8" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: commons-httpclient:commons-httpclient:3.1" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: org.twitter4j:twitter4j-core:4.0.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: commons-cli:commons-cli:1.4" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: com.rometools:rome-utils:1.7.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: commons-net:commons-net:3.6" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: org.jdom:jdom2:2.0.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: commons-logging:commons-logging:1.2" level="project" /> <orderEntry type="library" scope="RUNTIME" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: commons-codec:commons-codec:1.10" level="project" /> <orderEntry type="module-library" scope="RUNTIME">
<orderEntry type="library" scope="PROVIDED" name="Gradle: pircbot:pircbot:1.5.0" level="project" /> <library name="Gradle: owm-japis-2.5.0.5">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../lib/owm-japis-2.5.0.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" scope="TEST" name="Gradle: log4j:log4j:1.2.17" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: pircbot:pircbot:1.5.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: commons-logging:commons-logging:1.2" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: commons-net:commons-net:3.6" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: commons-cli:commons-cli:1.4" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: commons-httpclient:commons-httpclient:3.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: oro:oro:2.0.8" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.jsoup:jsoup:1.10.2" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.rometools:rome:1.7.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.slf4j:slf4j-log4j12:1.7.25" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.json:json:20160810" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.ostermiller:utils:1.07.00" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: net.objecthunter:exp4j:0.4.8" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.twitter4j:twitter4j-core:4.0.6" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.rometools:rome-utils:1.7.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.jdom:jdom2:2.0.6" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="module-library" scope="TEST">
<library name="Gradle: owm-japis-2.5.0.5">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../lib/owm-japis-2.5.0.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component> </component>
</module> </module>

View file

@ -70,7 +70,7 @@ dependencies {
compile 'net.objecthunter:exp4j:0.4.8' compile 'net.objecthunter:exp4j:0.4.8'
compile 'org.twitter4j:twitter4j-core:4.0.6' compile 'org.twitter4j:twitter4j-core:4.0.6'
compile 'net.sf.delicious-java:delicious:1.14' compile 'net.thauvin.erik:pinboard-poster:0.9.1'
compile files('lib/owm-japis-2.5.0.5.jar') compile files('lib/owm-japis-2.5.0.5.jar')

View file

@ -14,6 +14,7 @@ import java.io.FileInputStream
import java.util.* import java.util.*
val bs = buildScript { val bs = buildScript {
repos(localMaven())
} }
val mainClassName = "net.thauvin.erik.mobibot.Mobibot" val mainClassName = "net.thauvin.erik.mobibot.Mobibot"
@ -72,7 +73,7 @@ val p = project {
compile("net.objecthunter:exp4j:0.4.8") compile("net.objecthunter:exp4j:0.4.8")
compile("org.twitter4j:twitter4j-core:4.0.6") compile("org.twitter4j:twitter4j-core:4.0.6")
compile("net.sf.delicious-java:delicious:1.14") compile("net.thauvin.erik:pinboard-poster:0.9.1")
compile(file("lib/owm-japis-2.5.0.5.jar")) compile(file("lib/owm-japis-2.5.0.5.jar"))

View file

@ -357,6 +357,24 @@
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.rometools/rome/1.7.1/2bab37f921df082d245d440f96dc63a69cb5f67/rome-1.7.1-sources.jar!/" /> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.rometools/rome/1.7.1/2bab37f921df082d245d440f96dc63a69cb5f67/rome-1.7.1-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
<library name="Gradle: com.squareup.okhttp3:okhttp:3.8.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.8.0/5a11f020cce2d11eb71ba916700600e18c4547e7/okhttp-3.8.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.8.0/db21293949e200f08d5325e8a8eefdcc9134b752/okhttp-3.8.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: com.squareup.okio:okio:1.13.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.13.0/f4c91e12121af963e3ef76e81c82aa75ba6e8533/okio-1.13.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: commons-cli:commons-cli:1.4"> <library name="Gradle: commons-cli:commons-cli:1.4">
<CLASSES> <CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-cli/commons-cli/1.4/c51c00206bb913cd8612b24abd9fa98ae89719b1/commons-cli-1.4.jar!/" /> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-cli/commons-cli/1.4/c51c00206bb913cd8612b24abd9fa98ae89719b1/commons-cli-1.4.jar!/" />
@ -420,13 +438,13 @@
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.objecthunter/exp4j/0.4.8/8d86f148ff1f0d5b624eae9bb0882198ab5cd07/exp4j-0.4.8-sources.jar!/" /> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.objecthunter/exp4j/0.4.8/8d86f148ff1f0d5b624eae9bb0882198ab5cd07/exp4j-0.4.8-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
<library name="Gradle: net.sf.delicious-java:delicious:1.14"> <library name="Gradle: net.thauvin.erik:pinboard-poster:0.9.0">
<CLASSES> <CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.sf.delicious-java/delicious/1.14/6fdcbf3ef291e2a2352fc4c27fe033f02206ee1a/delicious-1.14.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/pinboard-poster/0.9.0/pinboard-poster-0.9.0.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES> <SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.sf.delicious-java/delicious/1.14/af3389b4f23bb9ac23552bff5ae6ed917df36192/delicious-1.14-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/pinboard-poster/0.9.0/pinboard-poster-0.9.0-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
<library name="Gradle: net.thauvin.erik:semver:1.0.0"> <library name="Gradle: net.thauvin.erik:semver:1.0.0">
@ -447,6 +465,24 @@
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jdom/jdom2/2.0.6/3dcf8ba7582eeac3b67ed5155ee3659e16c8dadc/jdom2-2.0.6-sources.jar!/" /> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jdom/jdom2/2.0.6/3dcf8ba7582eeac3b67ed5155ee3659e16c8dadc/jdom2-2.0.6-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
<library name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.1.2-3/552a40eb47669b78f0f194d526cb21b3aa1f8319/kotlin-stdlib-1.1.2-3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.1.2-3/7502cd343c8990a77aabb7cf41bd7e9f186c06cc/kotlin-stdlib-1.1.2-3-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.jetbrains:annotations:13.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/5991ca87ef1fb5544943d9abc5a9a37583fabe03/annotations-13.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.json:json:20160810"> <library name="Gradle: org.json:json:20160810">
<CLASSES> <CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.json/json/20160810/aca5eb39e2a12fddd6c472b240afe9ebea3a6733/json-20160810.jar!/" /> <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.json/json/20160810/aca5eb39e2a12fddd6c472b240afe9ebea3a6733/json-20160810.jar!/" />

View file

@ -11,8 +11,5 @@ log4j.appender.stderr.target=System.err
log4j.logger.org.apache.commons.httpclient=FATAL log4j.logger.org.apache.commons.httpclient=FATAL
log4j.logger.httpclient.wire=FATAL log4j.logger.httpclient.wire=FATAL
# Print only messages of priority FATAL or above in the package net.sf.jweather
log4j.category.net.sf.jweather=FATAL
# Print only messages of priority FATAL or above in the package net.thauvin.erik.mobibot # Print only messages of priority FATAL or above in the package net.thauvin.erik.mobibot
log4j.category.net.thauvin.erik.mobibot=FATAL log4j.category.net.thauvin.erik.mobibot=FATAL

View file

@ -21,11 +21,9 @@ tell-max-days=5
tell-max-size=50 tell-max-size=50
# #
# Credentials for: http://del.icio.us/ # Credentials for: http://pinboard.in/
# #
#delicious-user= #pinboard-api-token=user\:TOKEN
#delicious-pwd=
#declicious-api-endpoint=https://api.pinboard.in/v1/
# #

View file

@ -18,12 +18,12 @@ public final class ReleaseInfo {
public final static String PROJECT = "mobibot"; public final static String PROJECT = "mobibot";
public final static LocalDateTime BUILDDATE = public final static LocalDateTime BUILDDATE =
LocalDateTime.ofInstant(Instant.ofEpochMilli(1494906988487L), ZoneId.systemDefault()); LocalDateTime.ofInstant(Instant.ofEpochMilli(1495067438992L), ZoneId.systemDefault());
public final static int MAJOR = 0; public final static int MAJOR = 0;
public final static int MINOR = 7; public final static int MINOR = 7;
public final static int PATCH = 1; public final static int PATCH = 1;
public final static String PRERELEASE = "beta"; public final static String PRERELEASE = "beta";
public final static String BUILDMETA = "020"; public final static String BUILDMETA = "021";
/** /**
* The full version string. * The full version string.

View file

@ -206,11 +206,11 @@ public class EntryLink implements Serializable {
} }
/** /**
* Returns the tags formatted for del.icio.us. * Returns the tags formatted for pinboard.in
* *
* @return The tags as a comma-delimited string. * @return The tags as a comma-delimited string.
*/ */
public final String getDeliciousTags() { public final String getPinboardTags() {
final StringBuilder tags = new StringBuilder(nick); final StringBuilder tags = new StringBuilder(nick);
for (final Object tag : this.tags) { for (final Object tag : this.tags) {

View file

@ -32,7 +32,6 @@
package net.thauvin.erik.mobibot; package net.thauvin.erik.mobibot;
import com.rometools.rome.io.FeedException; import com.rometools.rome.io.FeedException;
import del.icio.us.DeliciousConstants;
import net.thauvin.erik.mobibot.modules.*; import net.thauvin.erik.mobibot.modules.*;
import net.thauvin.erik.semver.Version; import net.thauvin.erik.semver.Version;
import org.apache.commons.cli.*; import org.apache.commons.cli.*;
@ -167,22 +166,16 @@ public class Mobibot extends PircBot {
// The default tags/categories. // The default tags/categories.
private String defaultTags = ""; private String defaultTags = "";
// The del.icio.us posts handler.
private DeliciousPoster delicious = null;
// The feed URL. // The feed URL.
private String feedURL = ""; private String feedURL = "";
// The ident message. // The ident message.
private String identMsg = ""; private String identMsg = "";
// The ident nick. // The ident nick.
private String identNick = ""; private String identNick = "";
// The NickServ ident password. // The NickServ ident password.
private String identPwd = ""; private String identPwd = "";
// The pinboard posts handler.
private Pinboard pinboard = null;
// Today's date. // Today's date.
private String today = Utils.today(); private String today = Utils.today();
@ -356,10 +349,8 @@ public class Mobibot extends PircBot {
final String identPwd = p.getProperty("ident", ""); final String identPwd = p.getProperty("ident", "");
final String tags = p.getProperty("tags", ""); final String tags = p.getProperty("tags", "");
// Get the del.icio.us properties // Get the pinboard properties
final String dname = p.getProperty("delicious-user"); final String pinApiToken = p.getProperty("pinboard-api-token");
final String dpwd = p.getProperty("delicious-pwd");
final String dapi = p.getProperty("declicious-api-endpoint", DeliciousConstants.API_ENDPOINT);
// Create the bot // Create the bot
final Mobibot bot = new Mobibot(server, port, nickname, channel, logsDir); final Mobibot bot = new Mobibot(server, port, nickname, channel, logsDir);
@ -380,8 +371,8 @@ public class Mobibot extends PircBot {
bot.setFeedURL(feedURL); bot.setFeedURL(feedURL);
bot.setBacklogsUrl(backlogsURL); bot.setBacklogsUrl(backlogsURL);
// Set the del.icio.us authentication // Set the pinboard authentication
bot.setDeliciousAuth(dapi, dname, dpwd); bot.setPinboardAuth(pinApiToken);
// Load the modules properties // Load the modules properties
MODULES.stream().filter(AbstractModule::hasProperties).forEach( MODULES.stream().filter(AbstractModule::hasProperties).forEach(
@ -1044,8 +1035,8 @@ public class Mobibot extends PircBot {
final EntryLink entry = entries.get(index); final EntryLink entry = entries.get(index);
send(channel, Utils.buildLink(index, entry)); send(channel, Utils.buildLink(index, entry));
if (delicious != null) { if (pinboard != null) {
delicious.addPost(entry); pinboard.addPost(entry);
} }
saveEntries(isBackup); saveEntries(isBackup);
@ -1152,8 +1143,8 @@ public class Mobibot extends PircBot {
final EntryLink entry = entries.get(index); final EntryLink entry = entries.get(index);
if (entry.getLogin().equals(login) || isOp(sender)) { if (entry.getLogin().equals(login) || isOp(sender)) {
if (delicious != null) { if (pinboard != null) {
delicious.deletePost(entry); pinboard.deletePost(entry);
} }
entries.remove(index); entries.remove(index);
@ -1169,8 +1160,8 @@ public class Mobibot extends PircBot {
final EntryLink entry = entries.get(index); final EntryLink entry = entries.get(index);
entry.setTitle(cmd.substring(1).trim()); entry.setTitle(cmd.substring(1).trim());
if (delicious != null) { if (pinboard != null) {
delicious.updatePost(entry.getLink(), entry); pinboard.updatePost(entry.getLink(), entry);
} }
send(channel, Utils.buildLink(index, entry)); send(channel, Utils.buildLink(index, entry));
@ -1189,8 +1180,8 @@ public class Mobibot extends PircBot {
entry.setLink(link); entry.setLink(link);
if (delicious != null) { if (pinboard != null) {
delicious.updatePost(oldLink, entry); pinboard.updatePost(oldLink, entry);
} }
send(channel, Utils.buildLink(index, entry)); send(channel, Utils.buildLink(index, entry));
@ -1239,8 +1230,8 @@ public class Mobibot extends PircBot {
if (entry.getLogin().equals(login) || isOp(sender)) { if (entry.getLogin().equals(login) || isOp(sender)) {
entry.setTags(cmd); entry.setTags(cmd);
if (delicious != null) { if (pinboard != null) {
delicious.updatePost(entry.getLink(), entry); pinboard.updatePost(entry.getLink(), entry);
} }
send(channel, Utils.buildTags(index, entry)); send(channel, Utils.buildTags(index, entry));
@ -1491,19 +1482,6 @@ public class Mobibot extends PircBot {
send(sender, message, false); send(sender, message, false);
} }
/**
* Sets the del.icio.us authentication.
*
* @param apiEndPoint The API end point.
* @param username The del.icio.us user name.
* @param password The del.icio.us password.
*/
private void setDeliciousAuth(final String apiEndPoint, final String username, final String password) {
if (Utils.isValidString(username) && Utils.isValidString(password)) {
delicious = new DeliciousPoster(apiEndPoint, username, password, ircServer);
}
}
/** /**
* Sets the feed URL. * Sets the feed URL.
* *
@ -1541,6 +1519,17 @@ public class Mobibot extends PircBot {
} }
} }
/**
* Sets the pinboard authentication.
*
* @param apiToken The API token
*/
private void setPinboardAuth(final String apiToken) {
if (Utils.isValidString(apiToken)) {
pinboard = new Pinboard(this, apiToken, ircServer);
}
}
/** /**
* Sets the default tags/categories. * Sets the default tags/categories.
* *

View file

@ -1,5 +1,5 @@
/* /*
* DeliciousPoster.java * Pinboard.java
* *
* Copyright (c) 2004-2017, Erik C. Thauvin (erik@thauvin.net) * Copyright (c) 2004-2017, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved. * All rights reserved.
@ -31,32 +31,46 @@
*/ */
package net.thauvin.erik.mobibot; package net.thauvin.erik.mobibot;
import del.icio.us.Delicious; import net.thauvin.erik.pinboard.PinboardPoster;
import javax.swing.*; import javax.swing.*;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
/** /**
* The class to handle posts to del.icio.us. * The class to handle posts to pinbard.in.
* *
* @author <a href="http://erik.thauvin.net/" target="_blank">Erik C. Thauvin</a> * @author <a href="http://erik.thauvin.net/" target="_blank">Erik C. Thauvin</a>
* @created Mar 5, 2005 * @created 2017-05-17
* @since 1.0 * @since 1.0
*/ */
class DeliciousPoster { class Pinboard {
private final Delicious delicious;
private final String ircServer; private final String ircServer;
private final PinboardPoster pinboard;
/** /**
* Creates a new {@link DeliciousPoster} instance. * Creates a new {@link Pinboard} instance.
* *
* @param apiEndPoint The API end point. * @param bot The bot's instance.
* @param username The del.icio.us user name. * @param apiToken The API end point.
* @param password The del.icio.us password.
* @param ircServer The IRC server. * @param ircServer The IRC server.
*/ */
public DeliciousPoster(final String apiEndPoint, final String username, final String password, final String ircServer) { public Pinboard(final Mobibot bot, final String apiToken, final String ircServer) {
delicious = new Delicious(username, password, apiEndPoint); pinboard = new PinboardPoster(apiToken);
this.ircServer = ircServer; this.ircServer = ircServer;
if (bot.getLogger().isDebugEnabled()) {
final ConsoleHandler consoleHandler = new ConsoleHandler();
consoleHandler.setLevel(Level.FINE);
final Logger logger = pinboard.getLogger();
logger.addHandler(consoleHandler);
logger.setLevel(Level.FINE);
}
} }
/** /**
@ -69,11 +83,11 @@ class DeliciousPoster {
@Override @Override
protected Boolean doInBackground() protected Boolean doInBackground()
throws Exception { throws Exception {
return delicious.addPost(entry.getLink(), return pinboard.addPin(entry.getLink(),
entry.getTitle(), entry.getTitle(),
postedBy(entry), postedBy(entry),
entry.getDeliciousTags(), entry.getPinboardTags(),
entry.getDate()); formatDate(entry.getDate()));
} }
}; };
@ -92,13 +106,23 @@ class DeliciousPoster {
@Override @Override
protected Boolean doInBackground() protected Boolean doInBackground()
throws Exception { throws Exception {
return delicious.deletePost(link); return pinboard.deletePin(link);
} }
}; };
worker.execute(); worker.execute();
} }
/**
* Format a date to a UTC timestamp.
*
* @param date The date.
* @return The date in {@link DateTimeFormatter#ISO_INSTANT} format.
*/
private String formatDate(final Date date) {
return ZonedDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault()).format(DateTimeFormatter.ISO_INSTANT);
}
/** /**
* Returns he del.icio.us extended attribution line. * Returns he del.icio.us extended attribution line.
* *
@ -121,19 +145,19 @@ class DeliciousPoster {
protected Boolean doInBackground() protected Boolean doInBackground()
throws Exception { throws Exception {
if (!oldUrl.equals(entry.getLink())) { if (!oldUrl.equals(entry.getLink())) {
delicious.deletePost(oldUrl); pinboard.deletePin(oldUrl);
return delicious.addPost(entry.getLink(), return pinboard.addPin(entry.getLink(),
entry.getTitle(), entry.getTitle(),
postedBy(entry), postedBy(entry),
entry.getDeliciousTags(), entry.getPinboardTags(),
entry.getDate()); formatDate(entry.getDate()));
} else { } else {
return delicious.addPost(entry.getLink(), return pinboard.addPin(entry.getLink(),
entry.getTitle(), entry.getTitle(),
postedBy(entry), postedBy(entry),
entry.getDeliciousTags(), entry.getPinboardTags(),
entry.getDate(), formatDate(entry.getDate()),
true, true,
true); true);
} }

View file

@ -140,7 +140,7 @@ final public class Utils {
* @return The entry's tags. * @return The entry's tags.
*/ */
static String buildTags(final int entryIndex, final EntryLink entry) { static String buildTags(final int entryIndex, final EntryLink entry) {
return (Commands.LINK_CMD + (entryIndex + 1) + "T: " + entry.getDeliciousTags().replaceAll(",", ", ")); return (Commands.LINK_CMD + (entryIndex + 1) + "T: " + entry.getPinboardTags().replaceAll(",", ", "));
} }
/** /**

View file

@ -5,4 +5,4 @@ version.major=0
version.minor=7 version.minor=7
version.patch=1 version.patch=1
version.prerelease=beta version.prerelease=beta
version.buildmeta=020 version.buildmeta=021