Added API end point for Delicious.

This commit is contained in:
Erik C. Thauvin 2017-05-15 21:45:26 -07:00
parent 80d7f7c9db
commit 16953c8f98
9 changed files with 93 additions and 178 deletions

View file

@ -1,12 +1,14 @@
<?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="KOBALT" 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+018" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/../../kobaltBuild/classes" />
<output-test url="file://$MODULE_DIR$/../../kobaltBuild/test-classes" />
<output url="file://$MODULE_DIR$/../../build/classes/main" />
<output-test url="file://$MODULE_DIR$/../../build/classes/test" />
<exclude-output />
<content url="file://$MODULE_DIR$/../..">
<sourceFolder url="file://$MODULE_DIR$/../../src/generated/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/../../src/annotationProcessor/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/../../src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/../../src/test/resources" type="java-test-resource" />
<excludeFolder url="file://$MODULE_DIR$/../../.gradle" />
@ -15,44 +17,9 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="Kobalt: log4j:log4j:jar:1.2.17">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/log4j/log4j/1.2.17/log4j-1.2.17.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: org.slf4j:slf4j-api:jar:1.7.25">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: org.jdom:jdom2:jar:2.0.6">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/org/jdom/jdom2/2.0.6/jdom2-2.0.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: com.rometools:rome-utils:jar:1.7.1">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/com/rometools/rome-utils/1.7.1/rome-utils-1.7.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: file://.\lib\owm-japis-2.5.0.5.jar">
<orderEntry type="library" scope="PROVIDED" name="Gradle: log4j:log4j:1.2.17" 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>
@ -60,140 +27,81 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: net.sf.delicious-java:delicious:jar:1.14">
<orderEntry type="library" scope="TEST" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.jdom:jdom2:2.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: net.sf.delicious-java:delicious:1.14" 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: net.objecthunter:exp4j:0.4.8" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.ostermiller:utils:1.07.00" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.json:json:20160810" 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: com.rometools:rome:1.7.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.jsoup:jsoup:1.10.2" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: oro:oro:2.0.8" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: commons-httpclient:commons-httpclient:3.1" 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-net:commons-net:3.6" 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-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: pircbot:pircbot:1.5.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: log4j:log4j:1.2.17" level="project" />
<orderEntry type="module-library" scope="RUNTIME">
<library name="Gradle: owm-japis-2.5.0.5">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/net/sf/delicious-java/delicious/1.14/delicious-1.14.jar!/" />
<root url="jar://$MODULE_DIR$/../../lib/owm-japis-2.5.0.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: org.twitter4j:twitter4j-core:jar:4.0.6">
<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">
<library name="Gradle: owm-japis-2.5.0.5">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/org/twitter4j/twitter4j-core/4.0.6/twitter4j-core-4.0.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: net.objecthunter:exp4j:jar:0.4.8">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/net/objecthunter/exp4j/0.4.8/exp4j-0.4.8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: org.ostermiller:utils:jar:1.07.00">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/org/ostermiller/utils/1.07.00/utils-1.07.00.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: org.json:json:jar:20160810">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/org/json/json/20160810/json-20160810.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: org.slf4j:slf4j-log4j12:jar:1.7.25">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: com.rometools:rome:jar:1.7.1">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/com/rometools/rome/1.7.1/rome-1.7.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: org.jsoup:jsoup:jar:1.10.2">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/org/jsoup/jsoup/1.10.2/jsoup-1.10.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: oro:oro:jar:2.0.8">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/oro/oro/2.0.8/oro-2.0.8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: commons-httpclient:commons-httpclient:jar:3.1">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: commons-cli:commons-cli:jar:1.4">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/commons-cli/commons-cli/1.4/commons-cli-1.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: commons-net:commons-net:jar:3.6">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/commons-net/commons-net/3.6/commons-net-3.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: commons-logging:commons-logging:jar:1.2">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/commons-logging/commons-logging/1.2/commons-logging-1.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: commons-codec:commons-codec:jar:1.10">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/commons-codec/commons-codec/1.10/commons-codec-1.10.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: pircbot:pircbot:jar:1.5.0">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/pircbot/pircbot/1.5.0/pircbot-1.5.0.jar!/" />
<root url="jar://$MODULE_DIR$/../../lib/owm-japis-2.5.0.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.github.spullara.mustache.java:compiler:0.9.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.jdom:jdom2:2.0.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.rometools:rome-utils:1.7.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.thauvin.erik:semver:1.0.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.sf.delicious-java:delicious:1.14" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.twitter4j:twitter4j-core:4.0.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: net.objecthunter:exp4j:0.4.8" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.ostermiller:utils:1.07.00" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: org.json:json:20160810" level="project" />
<orderEntry type="library" scope="PROVIDED" 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="PROVIDED" name="Gradle: org.jsoup:jsoup:1.10.2" level="project" />
<orderEntry type="library" scope="PROVIDED" 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="PROVIDED" name="Gradle: commons-cli:commons-cli:1.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: commons-net:commons-net:3.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: commons-logging:commons-logging:1.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Gradle: pircbot:pircbot:1.5.0" level="project" />
</component>
</module>

View file

@ -110,6 +110,7 @@ val p = project {
}
install {
target = deploy
include(from("kobaltBuild/libs"), to(target), glob("**/*"))
include(from("properties"), to(target), glob("**/*.properties"))
collect(compileDependencies)

View file

@ -1,2 +1,2 @@
#!/bin/env sh
#!/usr/bin/env sh
java -jar "`dirname "$0"`/kobalt/wrapper/kobalt-wrapper.jar" $*

View file

@ -163,7 +163,7 @@
<option name="autoDownloadKobalt" value="true" />
<option name="downloadSources" value="false" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="kobaltHome" value="$USER_HOME$/.kobalt/wrapper/dist/kobalt-1.0.83" />
<option name="kobaltHome" value="$USER_HOME$/.kobalt/wrapper/dist/kobalt-1.0.86" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
@ -429,13 +429,13 @@
<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!/" />
</SOURCES>
</library>
<library name="Gradle: net.thauvin.erik:semver:0.9.7">
<library name="Gradle: net.thauvin.erik:semver:1.0.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/semver/0.9.7/semver-0.9.7.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/semver/1.0.0/semver-1.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/semver/0.9.7/semver-0.9.7-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/net/thauvin/erik/semver/1.0.0/semver-1.0.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: org.jdom:jdom2:2.0.6">

View file

@ -25,6 +25,8 @@ tell-max-size=50
#
#delicious-user=
#delicious-pwd=
#declicious-api-endpoint=https://api.pinboard.in/v1/
#
# Configure app at: https://apps.twitter.com/

View file

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

View file

@ -49,12 +49,13 @@ class DeliciousPoster {
/**
* Creates a new {@link DeliciousPoster} instance.
*
* @param apiEndPoint The API end point.
* @param username The del.icio.us user name.
* @param password The del.icio.us password.
* @param ircServer The IRC server.
*/
public DeliciousPoster(final String username, final String password, final String ircServer) {
delicious = new Delicious(username, password);
public DeliciousPoster(final String apiEndPoint, final String username, final String password, final String ircServer) {
delicious = new Delicious(username, password, apiEndPoint);
this.ircServer = ircServer;
}

View file

@ -32,6 +32,7 @@
package net.thauvin.erik.mobibot;
import com.rometools.rome.io.FeedException;
import del.icio.us.DeliciousConstants;
import net.thauvin.erik.mobibot.modules.*;
import net.thauvin.erik.semver.Version;
import org.apache.commons.cli.*;
@ -70,7 +71,7 @@ public class Mobibot extends PircBot {
// The info strings.
private static final String[] INFO_STRS = {
ReleaseInfo.PROJECT + " v" + ReleaseInfo.VERSION + " by Erik C. Thauvin (erik@thauvin.net)",
"http://www.mobitopia.org/mobibot/"
"https://www.mobitopia.org/mobibot/"
};
// The link match string.
@ -358,6 +359,7 @@ public class Mobibot extends PircBot {
// Get the del.icio.us properties
final String dname = p.getProperty("delicious-user");
final String dpwd = p.getProperty("delicious-pwd");
final String dapi = p.getProperty("declicious-api-endpoint", DeliciousConstants.API_ENDPOINT);
// Create the bot
final Mobibot bot = new Mobibot(server, port, nickname, channel, logsDir);
@ -379,7 +381,7 @@ public class Mobibot extends PircBot {
bot.setBacklogsUrl(backlogsURL);
// Set the del.icio.us authentication
bot.setDeliciousAuth(dname, dpwd);
bot.setDeliciousAuth(dapi, dname, dpwd);
// Load the modules properties
MODULES.stream().filter(AbstractModule::hasProperties).forEach(
@ -1492,12 +1494,13 @@ public class Mobibot extends PircBot {
/**
* 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 username, final String password) {
private void setDeliciousAuth(final String apiEndPoint, final String username, final String password) {
if (Utils.isValidString(username) && Utils.isValidString(password)) {
delicious = new DeliciousPoster(username, password, ircServer);
delicious = new DeliciousPoster(apiEndPoint, username, password, ircServer);
}
}

View file

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