Moved to gradle build system.

Using exp4j instead of MathEvaluator for calcuation now.
This commit is contained in:
Erik C. Thauvin 2014-04-19 21:16:53 -07:00
parent 3b9c5d6431
commit 5858e12b1a
50 changed files with 3124 additions and 1920 deletions

View file

@ -1,9 +0,0 @@
DevSuite
build
dist
log4j.properties
mobibot.properties
fetcher.properties
*.ser
logs
.git

23
.gitignore vendored
View file

@ -1,7 +1,20 @@
/build/
/dist/
CVS
/logs/
/mobibot.properties
.classpath
.gradle
.idea
.nb-gradle
.project
.settings
/bin
/build
/deploy
/dist
/fetcher.properties
/gen
/log4j.properties
/logs
/mobibot.properties
/out
/proguard-project.txt
/project.properties
/test-output
CVS

View file

@ -1,294 +0,0 @@
2005-11-08 14:58 erik
* buildnum.properties, mobibot.iml, mobibot.ipr, mobibot.iws,
lib/delicious-1.6.jar, lib/delicious-1.7.jar,
lib/delicious-1.9.jar, src/net/thauvin/erik/mobibot/Mobibot.java,
src/net/thauvin/erik/mobibot/ReleaseInfo.java: Added ability to
set the port. Added NickServ registartion. Updated to delicious
1.9 API. Update URL to mobitopia.org.
2005-08-08 21:53 erik
* lib/delicious-1.7.jar: Updated to delicious 1.7
2005-05-11 02:05 erik
* buildnum.properties, mobibot.iml, mobibot.ipr, mobibot.iws,
lib/commons-httpclient-3.0-rc1.jar,
lib/commons-httpclient-3.0-rc2.jar, lib/delicious-1.5.jar,
lib/delicious-1.6.jar,
src/net/thauvin/erik/mobibot/ReleaseInfo.java: Updated to
commons-httpclient 3.0rc2 Updated to delicious 1.6
2005-05-10 22:47 erik
* mobibot.iml, mobibot.iws, lib/commons-net-1.2.2.jar,
lib/commons-net-1.4.0.jar: Updated to commons-net 1.4.0
2005-05-05 12:47 erik
* properties/mobibot.properties,
src/net/thauvin/erik/mobibot/CurrencyConverter.java,
src/net/thauvin/erik/mobibot/DeliciousPoster.java,
src/net/thauvin/erik/mobibot/EntryLink.java,
src/net/thauvin/erik/mobibot/Mobibot.java, buildnum.properties,
mobibot.fb, mobibot.ipr, mobibot.iws,
src/net/thauvin/erik/mobibot/ReleaseInfo.java,
src/net/thauvin/erik/mobibot/StockQuote.java: Updated locations.
2005-03-06 13:04 erik
* mobibot.iws, lib/delicious-1.4.jar: Update to delcious-java 1.5.
2005-03-06 13:04 erik
* lib/delicious-1.5.jar, buildnum.properties, mobibot.iml,
mobibot.iws, src/net/thauvin/erik/mobibot/ReleaseInfo.java:
Update to delicious-java 1.5.
2005-03-06 08:30 erik
* ChangeLog.txt: Updated ChangeLog.
2005-03-06 08:28 erik
* buildnum.properties, mobibot.iws,
src/net/thauvin/erik/mobibot/DeliciousPoster.java,
src/net/thauvin/erik/mobibot/Mobibot.java,
src/net/thauvin/erik/mobibot/ReleaseInfo.java,
src/net/thauvin/erik/mobibot/SwingWorker.java: Added threading
while posting to del.icio.us.
2005-03-05 13:52 erik
* ChangeLog.txt, mobibot.iws, licenses/delicious-java License.txt,
website/index.html: Added delicious-java license. Updated
ChangeLog.
2005-03-05 13:40 erik
* lib/commons-codec-1.3.jar, lib/commons-httpclient-2.0.1.jar,
lib/commons-httpclient-3.0-rc1.jar, lib/delicious-1.4.jar,
properties/mobibot.properties, build.properties,
buildnum.properties, mobibot.iml, mobibot.ipr, mobibot.iws,
src/net/thauvin/erik/mobibot/DeliciousPoster.java,
src/net/thauvin/erik/mobibot/EntryLink.java,
src/net/thauvin/erik/mobibot/Mobibot.java,
src/net/thauvin/erik/mobibot/ReleaseInfo.java,
website/index.html: Added support for del.icio.us
2004-11-16 07:46 erik
* buildnum.properties, mobibot.iws,
src/net/thauvin/erik/mobibot/Mobibot.java,
src/net/thauvin/erik/mobibot/ReleaseInfo.java,
website/index.html: Added the ability to ignore nicknames.
2004-10-30 13:37 erik
* buildnum.properties, mobibot.iws,
src/net/thauvin/erik/mobibot/Mobibot.java,
src/net/thauvin/erik/mobibot/ReleaseInfo.java,
website/index.html: Added the ability to ignore links from
specified nicknames.
2004-10-04 07:22 erik
* build.properties, buildnum.properties, mobibot.iws,
src/net/thauvin/erik/mobibot/Mobibot.java,
src/net/thauvin/erik/mobibot/ReleaseInfo.java: Added
action(channel, action) method. Added input validation to
action/send methods.
2004-09-28 02:15 erik
* lib/MathEvaluator.jar: Fixed a problem with the MathEvaluator
library where "atan(), asin(), acos()" never worked right.
2004-09-27 18:36 erik
* .cvsignore, build.properties, build.xml, buildnum.properties,
mobibot.iml, mobibot.ipr, mobibot.iws,
ant/jreleaseinfo-1.2.0.jar, lib/EXML.jar, lib/fetchrss.jar,
lib/jdom-1.0.jar, lib/jdom.jar, lib/pircbot.jar,
lib/rome-0.4.jar, lib/rome-fetcher-0.4.jar, lib/rsslibj.jar,
licenses/EXML-license.txt, licenses/ROME License.txt,
licenses/RSSJLib License.txt, licenses/fetchrss License.txt,
properties/fetcher.properties,
src/net/thauvin/erik/mobibot/CurrencyConverter.java,
src/net/thauvin/erik/mobibot/EntryLink.java,
src/net/thauvin/erik/mobibot/FeedReader.java,
src/net/thauvin/erik/mobibot/GoogleSearch.java,
src/net/thauvin/erik/mobibot/Mobibot.java,
src/net/thauvin/erik/mobibot/ReleaseInfo.java,
src/net/thauvin/erik/mobibot/StockQuote.java,
src/net/thauvin/erik/mobibot/Weather.java, website/index.html:
Rome is now used to create and read the various feed.
2004-08-03 01:07 erik
* lib/commons-httpclient-2.0-final.jar, build.xml, mobibot.iml,
mobibot.ipr, mobibot.iws, lib/commons-httpclient-2.0.1.jar,
src/net/thauvin/erik/mobibot/Mobibot.java: Commons HTTPClinet
2.0.1 update. Added automated backup for the data file.
2004-07-07 07:10 erik
* lib/commons-logging.jar: Commons Logging 1.0.4 update.
2004-07-07 07:10 erik
* lib/pircbot.jar: PircBot 1.4.0 update.
2004-07-07 07:10 erik
* lib/: commons-net-1.2.0.jar, commons-net-1.2.2.jar: Commons Net
1.2.2 update.
2004-07-05 19:03 erik
* lib/: jweather-0.2.4.jar, jweather-0.2.5.jar: jweather 0.2.5
upgrade
2004-05-03 10:53 erik
* lib/: commons-net-1.1.0.jar, commons-net-1.2.0.jar,
jweather-0.2.3.jar, jweather-0.2.4.jar: commons-net 1.1.0 and
jweather 0.2.4
2004-03-10 09:05 erik
* .cvsignore: Ignore all serial files.
2004-03-10 09:04 erik
* src/net/thauvin/erik/mobibot/Mobibot.java: Removed angled
brackets around URLs as it was breaking Trillian. Added pong
command.
2004-03-10 09:03 erik
* src/net/thauvin/erik/mobibot/Weather.java: Added invalid station
ID message.
2004-03-10 09:03 erik
* src/net/thauvin/erik/mobibot/: FeedReader.java,
GoogleSearch.java: Removed angled brackets around URLs as it was
breaking Trillian.
2004-03-02 05:53 erik
* mobibot.iws, src/net/thauvin/erik/mobibot/Mobibot.java: Now uses
setAutoNickChange()
2004-03-02 05:52 erik
* lib/pircbot.jar: PircBot 1.3.0
2004-02-25 17:21 erik
* ChangeLog.txt: Initial import.
2004-02-25 16:27 erik
* mobibot.iws, src/net/thauvin/erik/mobibot/Mobibot.java: Added
random ping response.
2004-02-25 04:12 erik
* src/net/thauvin/erik/mobibot/: CurrencyConverter.java,
GoogleSearch.java, Mobibot.java, Weather.java: Added -serial
command line argument. Added ability to search the current URL
posts. Added ping command. Added more efficient arguments
parsing in the public and private commands. Added ability for
the originator to modify a post's URL. Removed the various
URL-based attributes from the constructor. Fixed the nick
command.
2004-02-24 05:09 erik
* README.txt: The properties file can now be specified from the
command line.
2004-02-24 04:58 erik
* website/index.html: Added reference to Commons CLI.
2004-02-24 04:56 erik
* mobibot.iml, mobibot.iws, lib/commons-cli-1.0.jar,
src/net/thauvin/erik/mobibot/Mobibot.java: The properties file
can now be specified from the command line.
2004-02-24 04:55 erik
* src/net/thauvin/erik/mobibot/CurrencyConverter.java: Added the
ability to list the current rates.
2004-02-18 03:40 erik
* src/net/thauvin/erik/mobibot/: Mobibot.java, Weather.java: The
weather command help is now returned when a station id is not
specified.
2004-02-17 06:10 erik
* README.txt: Added (very) minimal instructions.
2004-02-17 03:22 erik
* website/index.html: Added wiki reference.
2004-02-16 20:04 erik
* .cvsignore, build.properties, build.xml, mobibot.fb, mobibot.iml,
mobibot.ipr, mobibot.iws, lib/EXML.jar,
lib/commons-httpclient-2.0-final.jar, lib/commons-logging.jar,
lib/commons-net-1.1.0.jar, lib/fetchrss.jar, lib/google.jar,
lib/MathEvaluator.jar, lib/googleapi.jar,
lib/jakarta-oro-2.0.8.jar, lib/jdom.jar, lib/jweather-0.2.3.jar,
lib/log4j-1.2.8.jar, lib/pircbot.jar, lib/rsslibj.jar,
licenses/Commons License.txt, licenses/EXML-license.txt,
licenses/Google License.txt, licenses/GoogleTagLib License.txt,
licenses/JDOM License.txt, licenses/JWeather License.txt,
licenses/License.txt, licenses/Log4j License.txt,
licenses/PircBot License.html, licenses/RSSJLib License.txt,
licenses/fetchrss License.txt, properties/log4j.properties,
properties/mobibot.properties,
src/net/thauvin/erik/mobibot/CurrencyConverter.java,
src/net/thauvin/erik/mobibot/EntryComment.java,
src/net/thauvin/erik/mobibot/EntryLink.java,
src/net/thauvin/erik/mobibot/FeedReader.java,
src/net/thauvin/erik/mobibot/GoogleSearch.java,
src/net/thauvin/erik/mobibot/Mobibot.java,
src/net/thauvin/erik/mobibot/StockQuote.java,
src/net/thauvin/erik/mobibot/Weather.java, website/index.html,
website/simple.css: Initial import.
2004-02-16 20:04 erik
* .cvsignore, build.properties, build.xml, mobibot.fb, mobibot.iml,
mobibot.ipr, mobibot.iws, lib/EXML.jar,
lib/commons-httpclient-2.0-final.jar, lib/commons-logging.jar,
lib/commons-net-1.1.0.jar, lib/fetchrss.jar, lib/google.jar,
lib/MathEvaluator.jar, lib/googleapi.jar,
lib/jakarta-oro-2.0.8.jar, lib/jdom.jar, lib/jweather-0.2.3.jar,
lib/log4j-1.2.8.jar, lib/pircbot.jar, lib/rsslibj.jar,
licenses/Commons License.txt, licenses/EXML-license.txt,
licenses/Google License.txt, licenses/GoogleTagLib License.txt,
licenses/JDOM License.txt, licenses/JWeather License.txt,
licenses/License.txt, licenses/Log4j License.txt,
licenses/PircBot License.html, licenses/RSSJLib License.txt,
licenses/fetchrss License.txt, properties/log4j.properties,
properties/mobibot.properties,
src/net/thauvin/erik/mobibot/CurrencyConverter.java,
src/net/thauvin/erik/mobibot/EntryComment.java,
src/net/thauvin/erik/mobibot/EntryLink.java,
src/net/thauvin/erik/mobibot/FeedReader.java,
src/net/thauvin/erik/mobibot/GoogleSearch.java,
src/net/thauvin/erik/mobibot/Mobibot.java,
src/net/thauvin/erik/mobibot/StockQuote.java,
src/net/thauvin/erik/mobibot/Weather.java, website/index.html,
website/simple.css: Initial revision

View file

@ -1,16 +1,8 @@
Some very basic instructions:
ant jar
./gradlew deploy
mkdir run
cp dist/mobibot.jar run
cp -R lib run
cp properties/*.properties run
cd run
mkdir logs
cd deploy
{ configure the properties }
vi *.properties

90
build.gradle Normal file
View file

@ -0,0 +1,90 @@
apply plugin: 'java'
apply plugin: 'idea'
version = '0.5'
ext.packageName = 'net.thauvin.erik.mobibot'
ext.mainClassName = packageName + '.Mobibot'
ext.deployDir = 'deploy'
repositories {
mavenCentral()
}
dependencies {
compile 'log4j:log4j:1.2.17@jar'
compile 'pircbot:pircbot:1.5.0'
compile 'commons-codec:commons-codec:1.9'
compile 'commons-logging:commons-logging:1.1.3'
compile 'commons-net:commons-net:1.4.1'
compile 'commons-cli:commons-cli:1.2'
compile 'commons-httpclient:commons-httpclient:3.1'
compile 'oro:oro:2.0.8'
compile 'org.jdom:jdom:1.1.3'
compile 'org.jsoup:jsoup:1.7.3'
compile 'rome:rome:1.0@jar'
compile 'rome:rome-fetcher:1.0@jar'
compile 'org.json:json:20140107'
compile 'org.ostermiller:utils:1.07.00'
compile 'net.sourceforge.jweather:jweather:0.3.0@jar'
compile 'de.congrace:exp4j:0.3.11'
compile 'org.twitter4j:twitter4j-core:4.0.1'
compile 'net.sf.delicious-java:delicious:1.14'
//compile fileTree(dir: 'lib', include: '*.jar')
//compile files('../path/to/example.jar')
}
task wrapper(type: Wrapper) {
gradleVersion = gradle.gradleVersion
}
compileJava {
dependsOn wrapper
doFirst {
ant.taskdef(name: 'jreleaseinfo',
classname: 'ch.oscg.jreleaseinfo.anttask.JReleaseInfoAntTask',
classpath: 'ant/jreleaseinfo-1.3.0.jar')
ant.jreleaseinfo(targetDir: file('src/main/java'),
className: 'ReleaseInfo',
packageName: packageName,
project: rootProject.name,
version: version,
buildnumfile: file('buildnum.properties'))
}
}
jar {
doFirst {
manifest {
attributes("Manifest-Version": "1.0",
"Main-Class": mainClassName,
"Class-Path": '. ./lib/' + configurations.compile.collect { it.getName() }.join(' ./lib/'))
}
}
version = null
}
task deploy(dependsOn: build) {
description = "Copies all needed files to the ${deployDir} directory."
copy {
into deployDir + '/lib'
from configurations.runtime
}
copy {
from 'properties'
into deployDir
include('*.properties')
}
copy {
from jar
into deployDir
}
file(deployDir + '/logs').mkdirs();
}

View file

@ -1,52 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="mobibot" default="build" basedir=".">
<property file="${basedir}/build.properties" />
<path id="path.source">
<pathelement location="${path.src}" />
</path>
<path id="path.class">
<fileset dir="${path.lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="ant.class">
<fileset dir="${path.ant}">
<include name="**/*.jar"/>
</fileset>
</path>
<taskdef name="jreleaseinfo" classname="ch.oscg.jreleaseinfo.anttask.JReleaseInfoAntTask" classpathref="ant.class"/>
<target name="init">
<tstamp />
<mkdir dir="${path.classes}"/>
<mkdir dir="${path.dist}"/>
</target>
<target name="compile" depends="init" description="Compiles sources">
<jreleaseinfo targetDir="${basedir}/${path.src}" className="ReleaseInfo" packageName="${proj.package}" project="${proj.name}" version="${proj.version}" buildnumfile="${basedir}/buildnum.properties"/>
<mkdir dir="${path.classes}" />
<javac sourcepathref="path.source" classpathref="path.class" destdir="${path.classes}" debug="on" deprecation="on">
<src refid="path.source" />
</javac>
</target>
<target name="build" depends="clean,jar" description="Rebuilds project" />
<target name="jar" depends="compile" description="Builds the JAR">
<copy todir="${path.classes}">
<fileset dir="${path.src}" includes="*.properties" />
</copy>
<pathconvert targetos="unix" pathsep=" " property="mf.lib" refid="path.class">
<map from="${basedir}" to="."/>
</pathconvert>
<jar destfile="${basedir}/${path.dist}/${ant.project.name}.jar" basedir="${path.classes}" excludes="**/.dependency-info/**">
<manifest>
<attribute name="Main-Class" value="${proj.run}"/>
<attribute name="Class-Path" value=". ${mf.lib}"/>
</manifest>
</jar>
</target>
<target name="clean" depends="init" description="Removes classses">
<delete quiet="true" includeEmptyDirs="true">
<fileset dir="${path.classes}" includes="*,*/**"/>
<fileset dir="${path.dist}" includes="*,*/**"/>
</delete>
</target>
</project>

View file

@ -1,3 +1,3 @@
#ANT Task: ch.oscg.jreleaseinfo.BuildNumberHandler
#Wed Jun 12 14:18:56 PDT 2013
build.num.last=10
#Sat Apr 19 21:14:33 PDT 2014
build.num.last=40

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View file

@ -0,0 +1,6 @@
#Sat Apr 19 12:47:30 PDT 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-bin.zip

164
gradlew vendored Normal file
View file

@ -0,0 +1,164 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

90
gradlew.bat vendored Normal file
View file

@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,21 +0,0 @@
[Jar files]
D:\projects\java\mobibot\build
[Source dirs]
D:\projects\java\mobibot\src
[Aux classpath entries]
D:\projects\java\mobibot\lib\commons-cli-1.0.jar
D:\projects\java\mobibot\lib\commons-codec-1.3.jar
D:\projects\java\mobibot\lib\commons-httpclient-3.0-rc1.jar
D:\projects\java\mobibot\lib\commons-logging.jar
D:\projects\java\mobibot\lib\commons-net-1.2.2.jar
D:\projects\java\mobibot\lib\delicious-1.5.jar
D:\projects\java\mobibot\lib\google.jar
D:\projects\java\mobibot\lib\googleapi.jar
D:\projects\java\mobibot\lib\jakarta-oro-2.0.8.jar
D:\projects\java\mobibot\lib\jdom-1.0.jar
D:\projects\java\mobibot\lib\jweather-0.2.5.jar
D:\projects\java\mobibot\lib\log4j-1.2.8.jar
D:\projects\java\mobibot\lib\MathEvaluator.jar
D:\projects\java\mobibot\lib\pircbot.jar
D:\projects\java\mobibot\lib\rome-0.4.jar
D:\projects\java\mobibot\lib\rome-fetcher-0.4.jar

View file

@ -1,184 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<module relativePaths="false" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build" />
<module 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.5" relativePaths="false" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" 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/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/log4j-1.2.16.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="file://$MODULE_DIR$" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/MathEvaluator.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jweather-0.2.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/rome-fetcher-1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-codec-1.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-net-1.4.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/rome-1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/pircbot.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jdom-1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/delicious-1.14.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-httpclient-3.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-logging-1.1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-cli-1.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jakarta-oro-2.0.8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/ostermillerutils_1_07_00.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jsoup-1.6.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/twitter4j-core-3.0.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/json.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" exported="" name="Gradle: log4j-1.2.17" level="project" />
<orderEntry type="library" exported="" name="Gradle: pircbot-1.5.0" level="project" />
<orderEntry type="library" exported="" name="Gradle: commons-codec-1.9" level="project" />
<orderEntry type="library" exported="" name="Gradle: commons-logging-1.1.3" level="project" />
<orderEntry type="library" exported="" name="Gradle: commons-net-1.4.1" level="project" />
<orderEntry type="library" exported="" name="Gradle: commons-cli-1.2" level="project" />
<orderEntry type="library" exported="" name="Gradle: commons-httpclient-3.1" level="project" />
<orderEntry type="library" exported="" name="Gradle: oro-2.0.8" level="project" />
<orderEntry type="library" exported="" name="Gradle: jdom-1.1.3" level="project" />
<orderEntry type="library" exported="" name="Gradle: jsoup-1.7.3" level="project" />
<orderEntry type="library" exported="" name="Gradle: rome-1.0" level="project" />
<orderEntry type="library" exported="" name="Gradle: json-20140107" level="project" />
<orderEntry type="library" exported="" name="Gradle: utils-1.07.00" level="project" />
<orderEntry type="library" exported="" name="Gradle: jweather-0.3.0" level="project" />
<orderEntry type="library" exported="" name="Gradle: twitter4j-core-4.0.1" level="project" />
<orderEntry type="library" exported="" name="Gradle: delicious-1.14" level="project" />
<orderEntry type="library" exported="" name="Gradle: rome-fetcher-1.0" level="project" />
<orderEntry type="library" exported="" name="Gradle: exp4j-0.3.11" level="project" />
</component>
</module>

View file

@ -1,10 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/build.xml">
<customJdkName value="1.7.x" />
</buildFile>
</component>
<component name="BSFConsole">
<sendcommandbycontrolenter>false</sendcommandbycontrolenter>
<restoresystemstreams>false</restoresystemstreams>
@ -75,9 +70,7 @@
</profile>
</annotationProcessing>
</component>
<component name="CopyrightManager" default="">
<module2copyright />
</component>
<component name="CopyrightManager" default="" />
<component name="DependenciesAnalyzeManager">
<option name="myForwardDirection" value="false" />
</component>
@ -104,9 +97,67 @@
<option name="OPEN_IN_BROWSER" value="false" />
<option name="OUTPUT_DIRECTORY" />
</component>
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="createEmptyContentRootDirectories" value="true" />
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="C:/gradle" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
<option name="useAutoImport" value="true" />
</GradleProjectSettings>
</option>
</component>
<component name="IdProvider" IDEtalkID="ADF4C98C99466E4EF52C8D21B83FF938" />
<component name="InspectionProjectProfileManager">
<profiles>
<profile version="1.0" is_locked="false">
<option name="myName" value="Default" />
<option name="myLocal" value="false" />
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="TOP_LEVEL_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="INNER_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="METHOD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
</value>
</option>
<option name="FIELD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="IGNORE_DEPRECATED" value="false" />
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="created" />
</inspection_tool>
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
</profile>
<profile version="1.0" is_locked="false">
<option name="myName" value="Project Default" />
<option name="myLocal" value="false" />
@ -379,10 +430,10 @@
</inspection_tool>
<inspection_tool class="UnusedImport" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UtilityClassWithoutPrivateConstructor" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreClassesWithOnlyMain" value="false" />
<option name="ignorableAnnotations">
<value />
</option>
<option name="ignoreClassesWithOnlyMain" value="false" />
</inspection_tool>
<inspection_tool class="VarargParameter" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="WaitNotInLoop" enabled="true" level="WARNING" enabled_by_default="true" />
@ -565,15 +616,34 @@
</item>
</group>
</component>
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
</value>
</option>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Erik's Code Style" />
</component>
<component name="ProjectDetails">
<option name="projectName" value="mobibot" />
</component>
<component name="ProjectDictionaryState">
<dictionary name="erik">
<words>
<w>mobibot</w>
</words>
</dictionary>
</component>
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/mobibot.iml" filepath="$PROJECT_DIR$/mobibot.iml" />
</modules>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_3" assert-keyword="false" jdk-15="false" project-jdk-name="1.7.x" project-jdk-type="JavaSDK" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_3" assert-keyword="false" jdk-15="false" project-jdk-name="1.7.x" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="ResourceManagerContainer">
<option name="myResourceBundles">
<value>
@ -586,6 +656,7 @@
</component>
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
<component name="WebServicesPlugin" addRequiredLibraries="true" />
<component name="com.intellij.jsf.UserDefinedFacesConfigs">
@ -595,5 +666,176 @@
</value>
</option>
</component>
<component name="libraryTable">
<library name="Gradle: commons-cli-1.2">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-cli/commons-cli/1.2/2bf96b7aa8b611c177d329452af1dc933e14501c/commons-cli-1.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-cli/commons-cli/1.2/6c5459816530a1962ac18cd315cc775b1b384329/commons-cli-1.2-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: commons-codec-1.9">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.9/9ce04e34240f674bc72680f8b843b1457383161a/commons-codec-1.9.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.9/3f15fff45d57656685abfee9e8302bf14580044c/commons-codec-1.9-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: commons-httpclient-3.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-httpclient/commons-httpclient/3.1/964cd74171f427720480efdec40a7c7f6e58426a/commons-httpclient-3.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-httpclient/commons-httpclient/3.1/c6d6ea83d0cf16d3ed9c1b7e600fa0f60b9d3159/commons-httpclient-3.1-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: commons-logging-1.1.3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-logging/commons-logging/1.1.3/f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f/commons-logging-1.1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-logging/commons-logging/1.1.3/28bb0405fddaf04f15058fbfbe01fe2780d7d3b6/commons-logging-1.1.3-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: commons-net-1.4.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-net/commons-net/1.4.1/abb932adb2c10790c1eaa4365d3ac2a1ac7cb700/commons-net-1.4.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-net/commons-net/1.4.1/4c85b39e7f03471338bf7d36558eefe1e463e3de/commons-net-1.4.1-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: delicious-1.14">
<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!/" />
</CLASSES>
<JAVADOC />
<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!/" />
</SOURCES>
</library>
<library name="Gradle: exp4j-0.3.11">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/de.congrace/exp4j/0.3.11/150e7b4a77af47b03a1b65be7a01bd663ea64420/exp4j-0.3.11.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/de.congrace/exp4j/0.3.11/61abb5ef010830519e47ac56faade402807b245b/exp4j-0.3.11-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: jdom-1.1.3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jdom/jdom/1.1.3/8bdfeb39fa929c35f5e4f0b02d34350db39a1efc/jdom-1.1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jdom/jdom/1.1.3/b8b961a9f20d1faf160681c49f773a66b87efd63/jdom-1.1.3-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: json-20140107">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.json/json/20140107/d1ffca6e2482b002702c6a576166fd685e3370e3/json-20140107.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.json/json/20140107/f53f91bc9c21fef71745450dea5200e423e38370/json-20140107-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: jsoup-1.7.3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jsoup/jsoup/1.7.3/92568d7167ce1bf9eb1fd815b022d5a2c113547a/jsoup-1.7.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jsoup/jsoup/1.7.3/b783d347815471821faaa7ae7a4f0d2fec30966e/jsoup-1.7.3-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: jweather-0.3.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.sourceforge.jweather/jweather/0.3.0/8bb010d54c64e66b1738524513b50ed263c35290/jweather-0.3.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.sourceforge.jweather/jweather/0.3.0/385ecc27f62f9d7c31de57cee468a8df58cb415e/jweather-0.3.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: log4j-1.2.17">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/log4j/log4j/1.2.17/5af35056b4d257e4b64b9e8069c0746e8b08629f/log4j-1.2.17.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/log4j/log4j/1.2.17/677abe279b68c5e7490d6d50c6951376238d7d3e/log4j-1.2.17-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: MathEvaluator">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/MathEvaluator.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
<library name="Gradle: oro-2.0.8">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/oro/oro/2.0.8/5592374f834645c4ae250f4c9fbb314c9369d698/oro-2.0.8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/oro/oro/2.0.8/3598e790ecd76ff7eb249853d4d00822ae1a5e71/oro-2.0.8-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: pircbot-1.5.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/pircbot/pircbot/1.5.0/7a9dd235e6e81db733212202cc4067b5625650cf/pircbot-1.5.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/pircbot/pircbot/1.5.0/cc27715d1c9c8246beb6a33ea099a9ca5d4e5da1/pircbot-1.5.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: rome-1.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/rome/rome/1.0/22b33347f315833e9348cec2751af1a5d5656e4/rome-1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/rome/rome/1.0/195e9a962672c32943ec8883e010b6a5ea568745/rome-1.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: rome-fetcher-1.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/rome/rome-fetcher/1.0/6044bcd5d6f793fa3a38843e774e58c0737a7125/rome-fetcher-1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/rome/rome-fetcher/1.0/a36d7419a32690c5f47a625691c5490d67b72d4e/rome-fetcher-1.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: twitter4j-core-4.0.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.twitter4j/twitter4j-core/4.0.1/37fd1d1eb3ed57916c9fdd1ea1f6c3afce778c7c/twitter4j-core-4.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.twitter4j/twitter4j-core/4.0.1/f1ba5ef4a200e94857bc49d41385a364f1b5571e/twitter4j-core-4.0.1-sources.jar!/" />
</SOURCES>
</library>
<library name="Gradle: utils-1.07.00">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ostermiller/utils/1.07.00/a8828217b2dd0507fbe9e9d0b2981acfb908b590/utils-1.07.00.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ostermiller/utils/1.07.00/586774ee4b8409b6835621bae2186d9b54d1c36a/utils-1.07.00-sources.jar!/" />
</SOURCES>
</library>
</component>
</project>

File diff suppressed because it is too large Load diff

View file

@ -15,8 +15,10 @@ weblog=http://www.mobitopia.org/
feed=http://www.mobitopia.org/rss.xml
backlogs=http://www.mobitopia.org/mobibot/logs
delicious-user=mobibot
delicious-pwd=changepwd
#delicious-user=
#delicious-pwd=
#identica-user=mobitopia
#identica-pwd=changepwd
#twitter-consumerKey=
#twitter-consumerSecret=
#twitter-token=
#twitter-tokenSecret=

19
settings.gradle Normal file
View file

@ -0,0 +1,19 @@
/*
* This settings file was auto generated by the Gradle buildInit task
* by 'erik' at '4/19/14 12:47 PM' with Gradle 1.11
*
* The settings file is used to specify which projects to include in your build.
* In a single project build this file can be empty or even removed.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user guide at http://gradle.org/docs/1.11/userguide/multi_project_builds.html
*/
/*
// To declare projects as part of a multi-project build use the 'include' method
include 'shared'
include 'api'
include 'services:webservice'
*/
rootProject.name = 'mobibot'

View file

@ -40,24 +40,18 @@ import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.Namespace;
import org.jdom.input.SAXBuilder;
import java.io.IOException;
import java.net.URL;
import java.text.NumberFormat;
import java.util.*;
/**
* Converts various currencies.
*
* @author Erik C. Thauvin
* @version $Revision$, $Date$
*
* @created Feb 11, 2004
* @since 1.0
*/
@ -78,11 +72,6 @@ public class CurrencyConverter implements Runnable
*/
private static final String RATES_KEYWORD = "rates";
/**
* The last exchange rates table publication date.
*/
private String s_date = "";
/**
* The bot.
*/
@ -98,6 +87,11 @@ public class CurrencyConverter implements Runnable
*/
private final String _sender;
/**
* The last exchange rates table publication date.
*/
private String s_date = "";
/**
* Creates a new CurrencyConverter object.
*
@ -155,8 +149,7 @@ public class CurrencyConverter implements Runnable
catch (IOException e)
{
_bot.getLogger().debug("Unable to fetch the exchange rates table.", e);
_bot.send(_sender,
"An error has occurred while fetching the exchange rates table: " + e.getMessage());
_bot.send(_sender, "An error has occurred while fetching the exchange rates table: " + e.getMessage());
}
}
@ -181,15 +174,15 @@ public class CurrencyConverter implements Runnable
final double to = Double.parseDouble((String) EXCHANGE_RATES.get(cmds[3].toUpperCase()));
_bot.send(_bot.getChannel(),
NumberFormat.getCurrencyInstance(Locale.US).format(amt).substring(1) + ' ' +
cmds[1].toUpperCase() + " = " +
NumberFormat.getCurrencyInstance(Locale.US).format((amt * to) / from)
.substring(1) + ' ' + cmds[3].toUpperCase());
NumberFormat.getCurrencyInstance(Locale.US).format(amt).substring(1) + ' ' +
cmds[1].toUpperCase() + " = " +
NumberFormat.getCurrencyInstance(Locale.US).format((amt * to) / from).substring(1)
+ ' ' + cmds[3].toUpperCase()
);
}
catch (NullPointerException ignore)
catch (NullPointerException ignored)
{
_bot.send(_sender,
"The supported currencies are: " + EXCHANGE_RATES.keySet().toString());
_bot.send(_sender, "The supported currencies are: " + EXCHANGE_RATES.keySet().toString());
}
}
}

View file

@ -38,26 +38,26 @@ package net.thauvin.erik.mobibot;
import del.icio.us.Delicious;
/**
* The class to handle posts to del.icio.us.
*
* @author Erik C. Thauvin
* @version $Revision$, $Date$
* @created Mar 5, 2005
* @since 1.0
* @author Erik C. Thauvin
* @version $Revision$, $Date$
* @created Mar 5, 2005
* @noinspection UnnecessaryBoxing
* @since 1.0
*/
public class DeliciousPoster
{
private final Delicious _delicious;
private final String _ircServer;
/**
* Creates a new DeliciousPoster instance.
*
* @param username The del.icio.us username.
* @param password The del.icio.us password.
* @param username The del.icio.us username.
* @param password The del.icio.us password.
* @param ircServer The IRC server.
*/
public DeliciousPoster(String username, String password, String ircServer)
@ -73,15 +73,17 @@ public class DeliciousPoster
*/
public final void addPost(final EntryLink entry)
{
final SwingWorker worker =
new SwingWorker()
final SwingWorker worker = new SwingWorker()
{
public Object construct()
{
public Object construct()
{
return Boolean.valueOf(_delicious.addPost(entry.getLink(), entry.getTitle(), postedBy(entry),
entry.getDeliciousTags(), entry.getDate()));
}
};
return Boolean.valueOf(_delicious.addPost(entry.getLink(),
entry.getTitle(),
postedBy(entry),
entry.getDeliciousTags(),
entry.getDate()));
}
};
worker.start();
}
@ -95,14 +97,13 @@ public class DeliciousPoster
{
final String link = entry.getLink();
final SwingWorker worker =
new SwingWorker()
final SwingWorker worker = new SwingWorker()
{
public Object construct()
{
public Object construct()
{
return Boolean.valueOf(_delicious.deletePost(link));
}
};
return Boolean.valueOf(_delicious.deletePost(link));
}
};
worker.start();
}
@ -111,39 +112,44 @@ public class DeliciousPoster
* Updates a post to del.icio.us.
*
* @param oldUrl The old post URL.
* @param entry The entry to add.
* @param entry The entry to add.
*/
public final void updatePost(final String oldUrl, final EntryLink entry)
{
final SwingWorker worker =
new SwingWorker()
final SwingWorker worker = new SwingWorker()
{
public Object construct()
{
public Object construct()
if (!oldUrl.equals(entry.getLink()))
{
if (!oldUrl.equals(entry.getLink()))
{
_delicious.deletePost(oldUrl);
_delicious.deletePost(oldUrl);
return Boolean.valueOf(_delicious.addPost(entry.getLink(), entry.getTitle(), postedBy(entry),
entry.getDeliciousTags(), entry.getDate()));
}
else
{
return Boolean.valueOf(_delicious.addPost(entry.getLink(), entry.getTitle(), postedBy(entry),
entry.getDeliciousTags(), entry.getDate(), true,
true));
}
return Boolean.valueOf(_delicious.addPost(entry.getLink(),
entry.getTitle(),
postedBy(entry),
entry.getDeliciousTags(),
entry.getDate()));
}
};
else
{
return Boolean.valueOf(_delicious.addPost(entry.getLink(),
entry.getTitle(),
postedBy(entry),
entry.getDeliciousTags(),
entry.getDate(),
true,
true));
}
}
};
worker.start();
}
/**
* Returns he del.icio.us extended attribution line.
*
* @param entry The entry.
* @param entry The entry.
*
* @return The extended attribution line.
*/

View file

@ -37,17 +37,14 @@
package net.thauvin.erik.mobibot;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
/**
* The class used to store comments associated to a specific entry.
*
* @author Erik C. Thauvin
* @version $Revision$, $Date$
*
* @created Jan 31, 2004
* @since 1.0
*/
@ -62,7 +59,9 @@ public class EntryComment implements Serializable
* The creation date.
*/
private final Date _date = Calendar.getInstance().getTime();
private String _comment = "";
private String _nick = "";
/**
@ -79,22 +78,13 @@ public class EntryComment implements Serializable
/**
* Creates a new comment.
* @noinspection UnusedDeclaration
*/
protected EntryComment()
{
; // Required for serialization.
}
/**
* Sets the comment.
*
* @param comment The actual comment.
*/
public final void setComment(String comment)
{
_comment = comment;
}
/**
* Returns the comment.
*
@ -105,6 +95,17 @@ public class EntryComment implements Serializable
return _comment;
}
/**
* Sets the comment.
*
* @param comment The actual comment.
* @noinspection UnusedDeclaration
*/
public final void setComment(String comment)
{
_comment = comment;
}
/**
* Returns the comment's creation date.
*
@ -115,16 +116,6 @@ public class EntryComment implements Serializable
return _date;
}
/**
* Sets the nickname of the author of the comment.
*
* @param nick The new nickname.
*/
public final void setNick(String nick)
{
_nick = nick;
}
/**
* Returns the nickname of the author of the comment.
*
@ -134,4 +125,14 @@ public class EntryComment implements Serializable
{
return _nick;
}
/**
* Sets the nickname of the author of the comment.
*
* @param nick The new nickname.
*/
public final void setNick(String nick)
{
_nick = nick;
}
}

View file

@ -39,17 +39,18 @@ package net.thauvin.erik.mobibot;
import com.sun.syndication.feed.synd.SyndCategoryImpl;
import java.io.Serializable;
import java.util.*;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/**
* The class used to store link entries.
*
* @author Erik C. Thauvin
* @author Erik C. Thauvin
* @version $Revision$, $Date$
* @created Jan 31, 2004
* @since 1.0
* @since 1.0
*/
public class EntryLink implements Serializable
{
@ -58,12 +59,15 @@ public class EntryLink implements Serializable
*/
static final long serialVersionUID = 3676245542270899086L;
// The channel
private String _channel = "";
// The link's comments
private final List _comments = new ArrayList(0);
// The tags/categories
private final List _tags = new ArrayList(0);
// The channel
private String _channel = "";
// The creation date
private Date _date = Calendar.getInstance().getTime();
@ -76,21 +80,18 @@ public class EntryLink implements Serializable
// The author's nickname
private String _nick = "";
// The tags/categories
private final List _tags = new ArrayList(0);
// The link's title
private String _title = "";
/**
* Creates a new entry.
*
* @param link The new entry's link.
* @param title The new entry's title.
* @param nick The nickname of the author of the link.
* @param login The login of the author of the link.
* @param link The new entry's link.
* @param title The new entry's title.
* @param nick The nickname of the author of the link.
* @param login The login of the author of the link.
* @param channel The channel.
* @param tags The entry's tags/categories.
* @param tags The entry's tags/categories.
*/
public EntryLink(String link, String title, String nick, String login, String channel, String tags)
{
@ -103,16 +104,15 @@ public class EntryLink implements Serializable
setTags(tags);
}
/**
* Creates a new entry.
*
* @param link The new entry's link.
* @param title The new entry's title.
* @param nick The nickname of the author of the link.
* @param link The new entry's link.
* @param title The new entry's title.
* @param nick The nickname of the author of the link.
* @param channel The channel.
* @param date The entry date.
* @param tags The entry's tags/categories.
* @param date The entry date.
* @param tags The entry's tags/categories.
*/
public EntryLink(String link, String title, String nick, String channel, Date date, List tags)
{
@ -122,12 +122,12 @@ public class EntryLink implements Serializable
_channel = channel;
_date = date;
setTags(tags);
}
/**
* Creates a new EntryLink object.
* @noinspection UnusedDeclaration
*/
protected EntryLink()
{
@ -137,8 +137,8 @@ public class EntryLink implements Serializable
/**
* Adds a new comment.
*
* @param comment The actual comment.
* @param nick The nickname of the author of the comment.
* @param comment The actual comment.
* @param nick The nickname of the author of the comment.
*
* @return The total number of comments for this entry.
*/
@ -172,10 +172,21 @@ public class EntryLink implements Serializable
return _channel;
}
/**
* Sets the channel.
*
* @param channel The channel.
* @noinspection UnusedDeclaration
*/
public final synchronized void setChannel(String channel)
{
_channel = channel;
}
/**
* Returns a comment.
*
* @param index The comment's index.
* @param index The comment's index.
*
* @return The specific comment.
*/
@ -242,6 +253,16 @@ public class EntryLink implements Serializable
return _link;
}
/**
* Sets the comment's link.
*
* @param link The new link.
*/
public final synchronized void setLink(String link)
{
_link = link;
}
/**
* Return's the comment's author login.
*
@ -252,6 +273,17 @@ public class EntryLink implements Serializable
return _login;
}
/**
* Set the comment's author login.
*
* @param login The new login.
* @noinspection UnusedDeclaration
*/
public final synchronized void setLogin(String login)
{
_login = login;
}
/**
* Returns the comment's author nickname.
*
@ -262,91 +294,6 @@ public class EntryLink implements Serializable
return _nick;
}
/**
* Returns the tags.
*
* @return The tags.
*/
public final synchronized List getTags()
{
return _tags;
}
/**
* Returns the comment's title.
*
* @return The title.
*/
public final synchronized String getTitle()
{
return _title;
}
/**
* Returns true if the entry has comments.
*
* @return true if there are comments, false otherwise.
*/
public final synchronized boolean hasComments()
{
return (!_comments.isEmpty());
}
/**
* Returns true if the entry has tags.
*
* @return true if there are tags, false otherwise.
*/
public final synchronized boolean hasTags()
{
return (!_tags.isEmpty());
}
/**
* Sets the channel.
*
* @param channel The channel.
*/
public final synchronized void setChannel(String channel)
{
_channel = channel;
}
/**
* /** Sets a comment.
*
* @param index The comment's index.
* @param comment The actual comment.
* @param nick The nickname of the author of the comment.
*/
public final synchronized void setComment(int index, String comment, String nick)
{
if (index < _comments.size())
{
_comments.set(index, new EntryComment(comment, nick));
}
}
/**
* Sets the comment's link.
*
* @param link The new link.
*/
public final synchronized void setLink(String link)
{
_link = link;
}
/**
* Set the comment's author login.
*
* @param login The new login.
*/
public final synchronized void setLogin(String login)
{
_login = login;
}
/**
* Sets the comment's author nickname.
*
@ -358,13 +305,13 @@ public class EntryLink implements Serializable
}
/**
* Sets the tags.
* Returns the tags.
*
* @param tags The tags.
* @return The tags.
*/
public final synchronized void setTags(List tags)
public final synchronized List getTags()
{
_tags.addAll(tags);
return _tags;
}
/**
@ -422,6 +369,16 @@ public class EntryLink implements Serializable
}
}
/**
* Returns the comment's title.
*
* @return The title.
*/
public final synchronized String getTitle()
{
return _title;
}
/**
* Sets the comment's title.
*
@ -432,6 +389,51 @@ public class EntryLink implements Serializable
_title = title;
}
/**
* Returns true if the entry has comments.
*
* @return true if there are comments, false otherwise.
*/
public final synchronized boolean hasComments()
{
return (!_comments.isEmpty());
}
/**
* Returns true if the entry has tags.
*
* @return true if there are tags, false otherwise.
*/
public final synchronized boolean hasTags()
{
return (!_tags.isEmpty());
}
/**
* /** Sets a comment.
*
* @param index The comment's index.
* @param comment The actual comment.
* @param nick The nickname of the author of the comment.
*/
public final synchronized void setComment(int index, String comment, String nick)
{
if (index < _comments.size())
{
_comments.set(index, new EntryComment(comment, nick));
}
}
/**
* Sets the tags.
*
* @param tags The tags.
*/
public final synchronized void setTags(List tags)
{
_tags.addAll(tags);
}
/**
* Returns a string representation of the object.
*
@ -439,17 +441,9 @@ public class EntryLink implements Serializable
*/
public final String toString()
{
final StringBuffer sb = new StringBuffer(super.toString());
sb.append("[ channel -> '").append(_channel).append('\'');
sb.append(", comments -> ").append(_comments);
sb.append(", date -> ").append(_date);
sb.append(", link -> '").append(_link).append('\'');
sb.append(", login -> '").append(_login).append('\'');
sb.append(", nick -> '").append(_nick).append('\'');
sb.append(", tags -> ").append(_tags);
sb.append(", title -> '").append(_title).append('\'');
sb.append(" ]");
return sb.toString();
return super.toString() + "[ channel -> '" + _channel + '\'' + ", comments -> " + _comments + ", date -> "
+ _date + ", link -> '" + _link + '\'' + ", login -> '" + _login + '\'' + ", nick -> '" + _nick + '\''
+ ", tags -> " + _tags + ", title -> '" + _title + '\'' + " ]";
}
}

View file

@ -44,16 +44,13 @@ import com.sun.syndication.fetcher.impl.HttpURLFeedFetcher;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
/**
* Reads a RSS feed.
*
* @author Erik C. Thauvin
* @version $Revision$, $Date$
*
* @created Feb 1, 2004
* @since 1.0
*/

View file

@ -36,8 +36,9 @@
*/
package net.thauvin.erik.mobibot;
import twitter4j.internal.org.json.JSONArray;
import twitter4j.internal.org.json.JSONObject;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.InputStreamReader;

View file

@ -1,5 +1,5 @@
/* Created by JReleaseInfo AntTask from Open Source Competence Group */
/* Creation date Wed Jun 12 14:18:56 PDT 2013 */
/* Creation date Sat Apr 19 21:14:33 PDT 2014 */
package net.thauvin.erik.mobibot;
import java.util.Date;
@ -20,23 +20,16 @@ public class ReleaseInfo {
}
/** buildDate (set during build process to 1371071936682L). */
private static final Date buildDate = new Date(1371071936682L);
/** buildDate (set during build process to 1397967273141L). */
private static final Date buildDate = new Date(1397967273141L);
/**
* Get buildDate (set during build process to Wed Jun 12 14:18:56 PDT 2013).
* Get buildDate (set during build process to Sat Apr 19 21:14:33 PDT 2014).
* @return Date buildDate
*/
public static Date getBuildDate() { return buildDate; }
/**
* Get buildNumber (set during build process to 10).
* @return int buildNumber
*/
public static int getBuildNumber() { return 10; }
/** project (set during build process to "mobibot"). */
private static final String project = "mobibot";
@ -56,4 +49,11 @@ public class ReleaseInfo {
*/
public static String getVersion() { return version; }
/**
* Get buildNumber (set during build process to 40).
* @return int buildNumber
*/
public static int getBuildNumber() { return 40; }
}

View file

@ -13,6 +13,8 @@ import javax.swing.SwingUtilities;
* Note that the API changed slightly in the 3rd version:
* You must now invoke start() on the SwingWorker after
* creating it.
*
* @noinspection ALL
*/
public abstract class SwingWorker {
private Object value; // see getValue(), setValue()

View file

@ -122,12 +122,8 @@ public class Twitter implements Runnable
_bot.send(_sender,
"You message was posted to http://twitter.com/" + twitter.getScreenName() + "/statuses/" + status
.getId());
twitter.shutdown();
// @TODO Does it help?
twitter4j.internal.json.DataObjectFactoryUtil.clearThreadLocalMap();
.getId()
);
}
catch (Exception e)
{

View file

@ -56,7 +56,8 @@ public class TwitterOAuth
System.out.println(
"Please add the following to the bot's property file:" + "\n\n" + "twitter-consumerKey="
+ args[0] + '\n' + "twitter-consumerSecret=" + args[1] + '\n' + "twitter-token="
+ accessToken.getToken() + '\n' + "twitter-tokenSecret=" + accessToken.getTokenSecret());
+ accessToken.getToken() + '\n' + "twitter-tokenSecret=" + accessToken.getTokenSecret()
);
}
catch (TwitterException te)
{

View file

@ -116,9 +116,10 @@ public class Weather implements Runnable
_bot.send(_sender, "Station ID: " + metar.getStationID(), _isPrivate);
_bot.send(_sender,
"At: " + metar.getDateString() + " UTC ("
+ (((new Date()).getTime() - metar.getDate().getTime()) / 1000L / 60L) + " minutes ago)",
_isPrivate);
"At: " + metar.getDateString() + " UTC (" + (
((new Date()).getTime() - metar.getDate().getTime()) / 1000L / 60L) + " minutes ago)",
_isPrivate
);
result = metar.getWindSpeedInMPH();

View file

@ -1,141 +0,0 @@
/*
* @(#)Identica.java
*
* Copyright (C) 2010 Erik C. Thauvin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the author nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id$
*
*/
package net.thauvin.erik.mobibot;
import org.json.XML;
import twitter4j.internal.http.BASE64Encoder;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
/**
* The <code>Identica</code> class.
*
* @author <a href="mailto:erik@thauvin.net">Erik C. Thauvin</a>
* @version $Revision$, $Date$
* @created Sep 14, 2010
* @since 1.0
*/
public class Identica implements Runnable
{
/**
* The bot.
*/
private final Mobibot _bot;
/**
* The identi.ca user.
*/
private final String _user;
/**
* The identi.ca password.
*/
private final String _pwd;
/**
* The identi.ca message.
*/
private final String _message;
/**
* The nick of the person who sent the message.
*/
private final String _sender;
/**
* Creates a new identi.ca object.
*
* @param bot The bot.
* @param sender The nick of the person who sent the message.
* @param user The identi.ca user.
* @param pwd The identi.ca passwword.
* @param message The identi.ca message.
*/
public Identica(Mobibot bot, String sender, String user, String pwd, String message)
{
_bot = bot;
_sender = sender;
_user = user;
_pwd = pwd;
_message = message;
}
public final void run()
{
try
{
final String auth = _user + ':' + _pwd;
final URL url = new URL("http://identi.ca/api/statuses/update.xml");
final URLConnection conn = url.openConnection();
conn.setRequestProperty("Authorization", "Basic " + BASE64Encoder.encode(auth.getBytes()));
conn.setDoOutput(true);
final OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write("status=" + URLEncoder.encode(_message + " (" + _sender + ')', "UTF-8"));
writer.flush();
final StringBuffer sb = new StringBuffer();
final BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = reader.readLine()) != null)
{
sb.append(line);
}
final JSONObject response = XML.toJSONObject(sb.toString());
final int id = response.getJSONObject("status").getInt("id");
_bot.send(_sender, "You message was posted to http://identi.ca/notice/" + id);
writer.close();
reader.close();
}
catch (Exception e)
{
_bot.getLogger().warn("Unable to post to identi.ca: " + _message, e);
_bot.send(_sender, "An error has occurred: " + e.getMessage());
}
}
}

View file

@ -14,16 +14,16 @@
<p><strong>mobibot</strong> is the <a href="http://www.mobitopia.org/"><strong>#mobitopia</strong></a> IRC channel bot. It is built on Paul Mutton's <a href="http://www.jibble.org/pircbot.php"><strong>PircBot Java-based Framework</strong></a>.</p>
<p>mobibot is making extensive use of various <strong>open source libraries</strong>, including:</p>
<ul>
<li><a href="http://jakarta.apache.org/commons/cli/">Commons CLI</a></li>
<li><a href="http://jakarta.apache.org/commons/httpclient/">Commons HTTPClient</a></li>
<li><a href="http://jakarta.apache.org/commons/logging/">Commons Logging</a></li>
<li><a href="http://jakarta.apache.org/commons/net/">Commons Net</a></li>
<li><a href="http://commons.apache.org/proper/commons-cli/">Commons CLI</a></li>
<li><a href="http://hc.apache.org/httpclient-3.x/">Commons HTTPClient</a></li>
<li><a href="http://commons.apache.org/proper/commons-logging/">Commons Logging</a></li>
<li><a href="http://commons.apache.org/proper/commons-net/">Commons Net</a></li>
<li><a href="http://sourceforge.net/projects/delicious-java/">delicious-java</a></li>
<li><a href="http://sourceforge.net/projects/jweather/">JWeather</a></li>
<li><a href="http://lts.online.fr/dev/java/math.evaluator/">MathEvaluator</a></li>
<li><a href="http://www.objecthunter.net/exp4j/">exp4j</a></li>
<li><a href="http://ostermiller.org/utils/">OstermillerUtils</a></li>
<li><a href="https://rome.dev.java.net/">Rome</a></li>
<li><a href="http://yusuke.homeip.net/twitter4j/en/index.html">Twitter4J</a></li>
<li><a href="http://rometools.github.io/rome/">Rome</a></li>
<li><a href="http://twitter4j.org/en/index.html">Twitter4J</a></li>
</ul>
<p>mobibot was written by <a href="http://erik.thauvin.net/"><strong>Erik C. Thauvin</strong></a> as a replacement for the channel's original <a href="http://usefulinc.com/chump/">ChumpBot</a>. </p>
<h3>Features</h3>
@ -41,7 +41,6 @@
<li>Displaying the time in various time zones</li>
<li>Listing the users on the channel</li>
<li>Displaying weather information</li>
<li>Posting to <a href="http://identi.ca/mobitopia">identi.ca</a></li>
<li>Posting to <a href="http://twitter.com/mobitopia">Twitter</a></li>
</ul>
<p>Some of the internal features include RSS feed backlogs, rolling logs, debugging toggle and much more.</p>