Parcourir la source

Add license headers, twitter and quote commands

master
Chris Smith il y a 14 ans
Parent
révision
547447992e
33 fichiers modifiés avec 685 ajouts et 64 suppressions
  1. 3
    0
      .gitmodules
  2. 1
    0
      externals/twitter4j
  3. 74
    10
      nbproject/build-impl.xml
  4. 4
    4
      nbproject/genfiles.properties
  5. 2
    0
      nbproject/project.properties
  6. 1
    0
      nbproject/project.xml
  7. 19
    2
      src/com/md87/charliebravo/CharlieBravo.java
  8. 19
    2
      src/com/md87/charliebravo/Command.java
  9. 19
    2
      src/com/md87/charliebravo/CommandOptions.java
  10. 20
    2
      src/com/md87/charliebravo/Config.java
  11. 19
    2
      src/com/md87/charliebravo/ConfigCache.java
  12. 19
    2
      src/com/md87/charliebravo/Followup.java
  13. 24
    2
      src/com/md87/charliebravo/InputHandler.java
  14. 19
    2
      src/com/md87/charliebravo/Response.java
  15. 19
    2
      src/com/md87/charliebravo/commands/AuthenticateCommand.java
  16. 19
    2
      src/com/md87/charliebravo/commands/CalcCommand.java
  17. 19
    2
      src/com/md87/charliebravo/commands/DefineCommand.java
  18. 19
    2
      src/com/md87/charliebravo/commands/FollowupsCommand.java
  19. 19
    2
      src/com/md87/charliebravo/commands/GitCommand.java
  20. 19
    2
      src/com/md87/charliebravo/commands/GoogleCommand.java
  21. 19
    2
      src/com/md87/charliebravo/commands/HelpCommand.java
  22. 19
    2
      src/com/md87/charliebravo/commands/IssueCommand.java
  23. 19
    2
      src/com/md87/charliebravo/commands/LawCommand.java
  24. 19
    2
      src/com/md87/charliebravo/commands/NewzbinCommand.java
  25. 19
    2
      src/com/md87/charliebravo/commands/QuitCommand.java
  26. 69
    0
      src/com/md87/charliebravo/commands/QuoteCommand.java
  27. 19
    2
      src/com/md87/charliebravo/commands/ReloadCommand.java
  28. 19
    2
      src/com/md87/charliebravo/commands/SetCommand.java
  29. 19
    2
      src/com/md87/charliebravo/commands/SkillCommand.java
  30. 19
    2
      src/com/md87/charliebravo/commands/SnippetsCommand.java
  31. 19
    2
      src/com/md87/charliebravo/commands/TranslateCommand.java
  32. 50
    0
      src/com/md87/charliebravo/commands/TwitterCommand.java
  33. 19
    2
      src/com/md87/charliebravo/commands/WhoisCommand.java

+ 3
- 0
.gitmodules Voir le fichier

@@ -10,3 +10,6 @@
10 10
 [submodule "externals/util"]
11 11
 	path = externals/util
12 12
 	url = ssh://renji/home/chris/git/util
13
+[submodule "externals/twitter4j"]
14
+	path = externals/twitter4j
15
+	url = git://github.com/yusuke/twitter4j.git

+ 1
- 0
externals/twitter4j

@@ -0,0 +1 @@
1
+Subproject commit b2daa7e011c26451ae4305bc9cc944513fdd1a73

+ 74
- 10
nbproject/build-impl.xml Voir le fichier

@@ -20,6 +20,13 @@ is divided into following sections:
20 20
 
21 21
         -->
22 22
 <project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="charliebravo-impl">
23
+    <fail message="Please build using Ant 1.7.1 or higher.">
24
+        <condition>
25
+            <not>
26
+                <antversion atleast="1.7.1"/>
27
+            </not>
28
+        </condition>
29
+    </fail>
23 30
     <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
24 31
     <!-- 
25 32
                 ======================
@@ -71,6 +78,7 @@ is divided into following sections:
71 78
         <condition property="have.sources">
72 79
             <or>
73 80
                 <available file="${src.src4.dir}"/>
81
+                <available file="${src.java.dir}"/>
74 82
                 <available file="${src.src3.dir}"/>
75 83
                 <available file="${src.src2.dir}"/>
76 84
                 <available file="${src.src.dir}"/>
@@ -129,6 +137,7 @@ is divided into following sections:
129 137
     </target>
130 138
     <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
131 139
         <fail unless="src.src4.dir">Must set src.src4.dir</fail>
140
+        <fail unless="src.java.dir">Must set src.java.dir</fail>
132 141
         <fail unless="src.src3.dir">Must set src.src3.dir</fail>
133 142
         <fail unless="src.src2.dir">Must set src.src2.dir</fail>
134 143
         <fail unless="src.src.dir">Must set src.src.dir</fail>
@@ -154,16 +163,24 @@ is divided into following sections:
154 163
     </target>
155 164
     <target name="-init-macrodef-javac">
156 165
         <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
157
-            <attribute default="${src.src4.dir}:${src.src3.dir}:${src.src2.dir}:${src.src.dir}:${src.dir}" name="srcdir"/>
166
+            <attribute default="${src.src4.dir}:${src.java.dir}:${src.src3.dir}:${src.src2.dir}:${src.src.dir}:${src.dir}" name="srcdir"/>
158 167
             <attribute default="${build.classes.dir}" name="destdir"/>
159 168
             <attribute default="${javac.classpath}" name="classpath"/>
160 169
             <attribute default="${includes}" name="includes"/>
161 170
             <attribute default="${excludes}" name="excludes"/>
162 171
             <attribute default="${javac.debug}" name="debug"/>
163
-            <attribute default="/does/not/exist" name="sourcepath"/>
172
+            <attribute default="${empty.dir}" name="sourcepath"/>
173
+            <attribute default="${empty.dir}" name="gensrcdir"/>
164 174
             <element name="customize" optional="true"/>
165 175
             <sequential>
176
+                <property location="${build.dir}/empty" name="empty.dir"/>
177
+                <mkdir dir="${empty.dir}"/>
166 178
                 <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
179
+                    <src>
180
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
181
+                            <include name="*"/>
182
+                        </dirset>
183
+                    </src>
167 184
                     <classpath>
168 185
                         <path path="@{classpath}"/>
169 186
                     </classpath>
@@ -173,7 +190,7 @@ is divided into following sections:
173 190
             </sequential>
174 191
         </macrodef>
175 192
         <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
176
-            <attribute default="${src.src4.dir}:${src.src3.dir}:${src.src2.dir}:${src.src.dir}:${src.dir}" name="srcdir"/>
193
+            <attribute default="${src.src4.dir}:${src.java.dir}:${src.src3.dir}:${src.src2.dir}:${src.src.dir}:${src.dir}" name="srcdir"/>
177 194
             <attribute default="${build.classes.dir}" name="destdir"/>
178 195
             <attribute default="${javac.classpath}" name="classpath"/>
179 196
             <sequential>
@@ -279,6 +296,8 @@ is divided into following sections:
279 296
                 <java classname="@{classname}" dir="${work.dir}" fork="true">
280 297
                     <jvmarg line="${debug-args-line}"/>
281 298
                     <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
299
+                    <jvmarg value="-Dfile.encoding=${source.encoding}"/>
300
+                    <redirector errorencoding="${source.encoding}" inputencoding="${source.encoding}" outputencoding="${source.encoding}"/>
282 301
                     <jvmarg line="${run.jvmargs}"/>
283 302
                     <classpath>
284 303
                         <path path="@{classpath}"/>
@@ -295,12 +314,15 @@ is divided into following sections:
295 314
     <target name="-init-macrodef-java">
296 315
         <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
297 316
             <attribute default="${main.class}" name="classname"/>
317
+            <attribute default="${run.classpath}" name="classpath"/>
298 318
             <element name="customize" optional="true"/>
299 319
             <sequential>
300 320
                 <java classname="@{classname}" dir="${work.dir}" fork="true">
321
+                    <jvmarg value="-Dfile.encoding=${source.encoding}"/>
322
+                    <redirector errorencoding="${source.encoding}" inputencoding="${source.encoding}" outputencoding="${source.encoding}"/>
301 323
                     <jvmarg line="${run.jvmargs}"/>
302 324
                     <classpath>
303
-                        <path path="${run.classpath}"/>
325
+                        <path path="@{classpath}"/>
304 326
                     </classpath>
305 327
                     <syspropertyset>
306 328
                         <propertyref prefix="run-sys-prop."/>
@@ -340,12 +362,18 @@ is divided into following sections:
340 362
         <!-- You can override this target in the ../build.xml file. -->
341 363
     </target>
342 364
     <target if="do.depend.true" name="-compile-depend">
343
-        <j2seproject3:depend/>
365
+        <pathconvert property="build.generated.subdirs">
366
+            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
367
+                <include name="*"/>
368
+            </dirset>
369
+        </pathconvert>
370
+        <j2seproject3:depend srcdir="${src.src4.dir}:${src.java.dir}:${src.src3.dir}:${src.src2.dir}:${src.src.dir}:${src.dir}:${build.generated.subdirs}"/>
344 371
     </target>
345 372
     <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
346
-        <j2seproject3:javac/>
373
+        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
347 374
         <copy todir="${build.classes.dir}">
348 375
             <fileset dir="${src.src4.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
376
+            <fileset dir="${src.java.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
349 377
             <fileset dir="${src.src3.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
350 378
             <fileset dir="${src.src2.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
351 379
             <fileset dir="${src.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
@@ -364,7 +392,7 @@ is divided into following sections:
364 392
     <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
365 393
         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
366 394
         <j2seproject3:force-recompile/>
367
-        <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${src.src4.dir}:${src.src3.dir}:${src.src2.dir}:${src.src.dir}:${src.dir}"/>
395
+        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.src4.dir}:${src.java.dir}:${src.src3.dir}:${src.src2.dir}:${src.src.dir}:${src.dir}"/>
368 396
     </target>
369 397
     <target name="-post-compile-single">
370 398
         <!-- Empty placeholder for easier customization. -->
@@ -430,11 +458,29 @@ is divided into following sections:
430 458
         <property location="${dist.jar}" name="dist.jar.resolved"/>
431 459
         <echo>java -jar "${dist.jar.resolved}"</echo>
432 460
     </target>
461
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="libs.CopyLibs.classpath" name="-do-jar-with-libraries-without-manifest" unless="manifest.available+main.class">
462
+        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
463
+        <pathconvert property="run.classpath.without.build.classes.dir">
464
+            <path path="${run.classpath}"/>
465
+            <map from="${build.classes.dir.resolved}" to=""/>
466
+        </pathconvert>
467
+        <pathconvert pathsep=" " property="jar.classpath">
468
+            <path path="${run.classpath.without.build.classes.dir}"/>
469
+            <chainedmapper>
470
+                <flattenmapper/>
471
+                <globmapper from="*" to="lib/*"/>
472
+            </chainedmapper>
473
+        </pathconvert>
474
+        <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
475
+        <copylibs compress="${jar.compress}" jarfile="${dist.jar}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
476
+            <fileset dir="${build.classes.dir}"/>
477
+        </copylibs>
478
+    </target>
433 479
     <target name="-post-jar">
434 480
         <!-- Empty placeholder for easier customization. -->
435 481
         <!-- You can override this target in the ../build.xml file. -->
436 482
     </target>
437
-    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
483
+    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-do-jar-with-libraries-without-manifest,-post-jar" description="Build JAR." name="jar"/>
438 484
     <!--
439 485
                 =================
440 486
                 EXECUTION SECTION
@@ -454,6 +500,10 @@ is divided into following sections:
454 500
         <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
455 501
         <j2seproject1:java classname="${run.class}"/>
456 502
     </target>
503
+    <target depends="init,-do-not-recompile,compile-test-single" name="run-test-with-main">
504
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
505
+        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
506
+    </target>
457 507
     <!--
458 508
                 =================
459 509
                 DEBUGGING SECTION
@@ -462,6 +512,9 @@ is divided into following sections:
462 512
     <target depends="init" if="netbeans.home" name="-debug-start-debugger">
463 513
         <j2seproject1:nbjpdastart name="${debug.class}"/>
464 514
     </target>
515
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
516
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
517
+    </target>
465 518
     <target depends="init,compile" name="-debug-start-debuggee">
466 519
         <j2seproject3:debug>
467 520
             <customize>
@@ -479,6 +532,11 @@ is divided into following sections:
479 532
         <j2seproject3:debug classname="${debug.class}"/>
480 533
     </target>
481 534
     <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
535
+    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
536
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
537
+        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
538
+    </target>
539
+    <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
482 540
     <target depends="init" name="-pre-debug-fix">
483 541
         <fail unless="fix.includes">Must set fix.includes</fail>
484 542
         <property name="javac.includes" value="${fix.includes}.java"/>
@@ -501,6 +559,9 @@ is divided into following sections:
501 559
             <fileset dir="${src.src4.dir}" excludes="${excludes}" includes="${includes}">
502 560
                 <filename name="**/*.java"/>
503 561
             </fileset>
562
+            <fileset dir="${src.java.dir}" excludes="${excludes}" includes="${includes}">
563
+                <filename name="**/*.java"/>
564
+            </fileset>
504 565
             <fileset dir="${src.src3.dir}" excludes="${excludes}" includes="${includes}">
505 566
                 <filename name="**/*.java"/>
506 567
             </fileset>
@@ -513,6 +574,9 @@ is divided into following sections:
513 574
             <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
514 575
                 <filename name="**/*.java"/>
515 576
             </fileset>
577
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
578
+                <include name="**/*.java"/>
579
+            </fileset>
516 580
         </javadoc>
517 581
     </target>
518 582
     <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
@@ -574,7 +638,7 @@ is divided into following sections:
574 638
         <j2seproject3:junit testincludes="**/*Test.java"/>
575 639
     </target>
576 640
     <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
577
-        <fail if="tests.failed">Some tests failed; see details above.</fail>
641
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
578 642
     </target>
579 643
     <target depends="init" if="have.tests" name="test-report"/>
580 644
     <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
@@ -587,7 +651,7 @@ is divided into following sections:
587 651
         <j2seproject3:junit excludes="" includes="${test.includes}"/>
588 652
     </target>
589 653
     <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
590
-        <fail if="tests.failed">Some tests failed; see details above.</fail>
654
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
591 655
     </target>
592 656
     <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
593 657
     <!--

+ 4
- 4
nbproject/genfiles.properties Voir le fichier

@@ -1,8 +1,8 @@
1
-build.xml.data.CRC32=aaeff047
1
+build.xml.data.CRC32=96efc3b9
2 2
 build.xml.script.CRC32=d4296ee3
3 3
 build.xml.stylesheet.CRC32=958a1d3e
4 4
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 5
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6
-nbproject/build-impl.xml.data.CRC32=aaeff047
7
-nbproject/build-impl.xml.script.CRC32=9c9a087f
8
-nbproject/build-impl.xml.stylesheet.CRC32=65b8de21
6
+nbproject/build-impl.xml.data.CRC32=96efc3b9
7
+nbproject/build-impl.xml.script.CRC32=f57586c1
8
+nbproject/build-impl.xml.stylesheet.CRC32=5c621a33@1.26.1.45

+ 2
- 0
nbproject/project.properties Voir le fichier

@@ -5,6 +5,7 @@ build.classes.excludes=**/*.java,**/*.form
5 5
 # This directory is removed when the project is cleaned:
6 6
 build.dir=build
7 7
 build.generated.dir=${build.dir}/generated
8
+build.generated.sources.dir=${build.dir}/generated-sources
8 9
 # Only compile against the classpath explicitly listed here:
9 10
 build.sysclasspath=ignore
10 11
 build.test.classes.dir=${build.dir}/test/classes
@@ -74,6 +75,7 @@ run.test.classpath=\
74 75
     ${build.test.classes.dir}
75 76
 source.encoding=UTF-8
76 77
 src.dir=src
78
+src.java.dir=externals/twitter4j/src/main/java
77 79
 src.src.dir=externals/dmdirc/src
78 80
 src.src2.dir=externals/evetool/src
79 81
 src.src3.dir=externals/dmdirc-plugins/calc/src

+ 1
- 0
nbproject/project.xml Voir le fichier

@@ -7,6 +7,7 @@
7 7
             <minimum-ant-version>1.6.5</minimum-ant-version>
8 8
             <source-roots>
9 9
                 <root id="src.src4.dir"/>
10
+                <root id="src.java.dir"/>
10 11
                 <root id="src.src3.dir"/>
11 12
                 <root id="src.src2.dir"/>
12 13
                 <root id="src.src.dir"/>

+ 19
- 2
src/com/md87/charliebravo/CharlieBravo.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo;

+ 19
- 2
src/com/md87/charliebravo/Command.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo;

+ 19
- 2
src/com/md87/charliebravo/CommandOptions.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo;

+ 20
- 2
src/com/md87/charliebravo/Config.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo;
@@ -24,6 +41,7 @@ public class Config implements Runnable {
24 41
 
25 42
     private static final List<String> SETTINGS = Arrays.asList(new String[] {
26 43
         "eve.apikey:String", "eve.userid:int", "eve.charid:int",
44
+        "twitter.username:String", "twitter.password:String",
27 45
         "admin.level:int",
28 46
         "internal.lastseen:int", "internal.lastuser:String"
29 47
     });

+ 19
- 2
src/com/md87/charliebravo/ConfigCache.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo;

+ 19
- 2
src/com/md87/charliebravo/Followup.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo;

+ 24
- 2
src/com/md87/charliebravo/InputHandler.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo;
@@ -29,7 +46,9 @@ import com.md87.charliebravo.commands.SetCommand;
29 46
 import com.md87.charliebravo.commands.SkillCommand;
30 47
 import com.md87.charliebravo.commands.SnippetsCommand;
31 48
 import com.md87.charliebravo.commands.LawCommand;
49
+import com.md87.charliebravo.commands.QuoteCommand;
32 50
 import com.md87.charliebravo.commands.TranslateCommand;
51
+import com.md87.charliebravo.commands.TwitterCommand;
33 52
 import com.md87.charliebravo.commands.WhoisCommand;
34 53
 import com.md87.util.crypto.ArcFourEncrypter;
35 54
 import java.util.ArrayList;
@@ -74,6 +93,8 @@ public class InputHandler implements IChannelMessage, IPrivateMessage, IPrivateC
74 93
         commands.add(new ReloadCommand());
75 94
         commands.add(new DefineCommand());
76 95
         commands.add(new LawCommand());
96
+        commands.add(new QuoteCommand());
97
+        commands.add(new TwitterCommand());
77 98
     }
78 99
 
79 100
     public Config getConfig() {
@@ -283,6 +304,7 @@ public class InputHandler implements IChannelMessage, IPrivateMessage, IPrivateC
283 304
                 }
284 305
             }
285 306
         } catch (Throwable ex) {
307
+            ex.printStackTrace();
286 308
             response.sendMessage("an error has occured: " + ex.getMessage());
287 309
             response.addFollowup(new StacktraceFollowup(ex));
288 310
         }

+ 19
- 2
src/com/md87/charliebravo/Response.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo;

+ 19
- 2
src/com/md87/charliebravo/commands/AuthenticateCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 19
- 2
src/com/md87/charliebravo/commands/CalcCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 19
- 2
src/com/md87/charliebravo/commands/DefineCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 19
- 2
src/com/md87/charliebravo/commands/FollowupsCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 19
- 2
src/com/md87/charliebravo/commands/GitCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 19
- 2
src/com/md87/charliebravo/commands/GoogleCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 19
- 2
src/com/md87/charliebravo/commands/HelpCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 19
- 2
src/com/md87/charliebravo/commands/IssueCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 19
- 2
src/com/md87/charliebravo/commands/LawCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 19
- 2
src/com/md87/charliebravo/commands/NewzbinCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 19
- 2
src/com/md87/charliebravo/commands/QuitCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 69
- 0
src/com/md87/charliebravo/commands/QuoteCommand.java Voir le fichier

@@ -0,0 +1,69 @@
1
+/*
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.md87.charliebravo.commands;
24
+
25
+import com.dmdirc.util.Downloader;
26
+import com.md87.charliebravo.Command;
27
+import com.md87.charliebravo.InputHandler;
28
+import com.md87.charliebravo.Response;
29
+
30
+import java.util.List;
31
+import java.util.regex.Matcher;
32
+import java.util.regex.Pattern;
33
+
34
+/**
35
+ *
36
+ * @author chris
37
+ */
38
+public class QuoteCommand implements Command {
39
+
40
+    protected static final String URL = "http://apps.md87.co.uk/quotes/rss?id=%s";
41
+
42
+    protected static final Pattern QUOTE_MATCHER = Pattern.compile(".*<description><![CDATA[(.*?)]]></description>.*");
43
+
44
+    public void execute(InputHandler handler, Response response, String line) throws Exception {
45
+        if (line.isEmpty()) {
46
+            response.sendMessage("You need to specify a quote number", true);
47
+        } else if (!line.matches("^[0-9]+$")) {
48
+            response.sendMessage("You need to specify a valid quote number", true);
49
+        } else {
50
+            final List<String> result = Downloader.getPage(String.format(URL, line));
51
+            final StringBuilder builder = new StringBuilder();
52
+
53
+            for (String rline : result) {
54
+                builder.append(rline);
55
+            }
56
+
57
+            final Matcher matcher = QUOTE_MATCHER.matcher(builder);
58
+
59
+            if (matcher.matches()) {
60
+                final String quote = matcher.group(1);
61
+                response.sendMessage("quote " + line + " is: " + quote);
62
+            } else {
63
+                response.sendMessage("There were no results for that quote", true);
64
+            }
65
+        }
66
+
67
+    }
68
+
69
+}

+ 19
- 2
src/com/md87/charliebravo/commands/ReloadCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 19
- 2
src/com/md87/charliebravo/commands/SetCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 19
- 2
src/com/md87/charliebravo/commands/SkillCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 19
- 2
src/com/md87/charliebravo/commands/SnippetsCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 19
- 2
src/com/md87/charliebravo/commands/TranslateCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

+ 50
- 0
src/com/md87/charliebravo/commands/TwitterCommand.java Voir le fichier

@@ -0,0 +1,50 @@
1
+/*
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.md87.charliebravo.commands;
24
+
25
+import com.md87.charliebravo.Command;
26
+import com.md87.charliebravo.CommandOptions;
27
+import com.md87.charliebravo.InputHandler;
28
+import com.md87.charliebravo.Response;
29
+import twitter4j.Twitter;
30
+
31
+/**
32
+ *
33
+ * @author chris
34
+ */
35
+@CommandOptions(requireAuthorisation=true, requiredSettings={"twitter.username","twitter.password"})
36
+public class TwitterCommand implements Command {
37
+
38
+    public void execute(InputHandler handler, Response response, String line) throws Exception {
39
+        final String openID = (String) handler.getParser().getClientInfoOrFake(response.getSource())
40
+                .getMap().get("OpenID");
41
+
42
+        String user = handler.getConfig().getOption(openID, "twitter.username");
43
+        String pass = handler.getConfig().getOption(openID, "twitter.password");
44
+
45
+        Twitter twitter = new Twitter(user, pass);
46
+        twitter.updateStatus(line);
47
+        response.sendMessage("Done", true);
48
+    }
49
+
50
+}

+ 19
- 2
src/com/md87/charliebravo/commands/WhoisCommand.java Voir le fichier

@@ -1,6 +1,23 @@
1 1
 /*
2
- * To change this template, choose Tools | Templates
3
- * and open the template in the editor.
2
+ * Copyright (c) 2009-2010 Chris Smith
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
4 21
  */
5 22
 
6 23
 package com.md87.charliebravo.commands;

Chargement…
Annuler
Enregistrer