OSDN Git Service

複数路線
authorYuji Konishi <yuji.k64613@gmail.com>
Sun, 11 Mar 2012 11:25:02 +0000 (20:25 +0900)
committerYuji Konishi <yuji.k64613@gmail.com>
Sun, 11 Mar 2012 11:25:02 +0000 (20:25 +0900)
129 files changed:
memo.txt
workspace/.metadata/.log
workspace/.metadata/.mylyn/.tasks.xml.zip
workspace/.metadata/.mylyn/tasks.xml.zip
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/0/80d0300c106b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/12/007d7e77666b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/12/50ffd5cf666b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/16/306ca0980e6b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/1a/c0baa0888b6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/1b/10fe5b37106b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/1f/70c5ac3c106b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/20/308671088c6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/26/c007379f136b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/2c/a09dafda8a6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/2e/80e83f5b8b6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/31/40ea2621906500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/31/5021e69b0e6b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/31/90efe23dee6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/36/a0dc6068116b001115b7b82f2f4ce01a [moved from workspace/.metadata/.plugins/org.eclipse.core.resources/.history/97/10c7ef0efa6500111e5bcf098ae37dc9 with 87% similarity]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/38/5033ef01d46a001115b0ad2bca3cccad [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/3b/302290e7646b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/3b/e0dcd1aa0e6b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/3c/30250be8eb6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/42/b0c6c14d8b6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/45/204c2062136b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/45/c0c9b7d4eb6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/46/f0fab198676b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/49/20d0d043666b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/4a/400c6497696b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/4b/4011f0b10e6b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/4c/a05c3cd8eb6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/5/903de7bf646b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/52/f064530c166b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/54/10334ae0e96500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/54/f0875033106b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/56/a0a02626106b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/5b/606e02a1126b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/5b/d0097442676b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/5d/807f3406136b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/64/202eb3df166b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/64/4052d11a106b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/64/60a80efbea6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/68/802098ddeb6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/6e/d081bb24666b001115b7b82f2f4ce01a [moved from workspace/.metadata/.plugins/org.eclipse.core.resources/.history/18/b0282c28ee6500111e5bcf098ae37dc9 with 64% similarity]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/70/502fb6d38a6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/73/204c5c5a666b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/75/80253805106b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/76/80ee2380906500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/78/404799cdeb6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/78/f08185a38f6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/7b/f0152533906500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/7c/005c8003136b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/7e/309e4416106b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/8/40d0961c8f6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/81/00122453646b001115b7b82f2f4ce01a [moved from workspace/.metadata/.plugins/org.eclipse.core.resources/.history/20/d0345547e86500111e5bcf098ae37dc9 with 100% similarity]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/82/60f5eed7ea6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/85/b0a8a6ff8a6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/87/50202ce0666b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/89/700228b4676b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/8a/f0c1cafa166b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/8b/50ef23a9eb6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/90/c0b28524ea6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/93/c032e2e8666b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/95/803f40638b6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/97/d0086a6c116b001115b7b82f2f4ce01a [moved from workspace/.metadata/.plugins/org.eclipse.core.resources/.history/69/e004632f906500111e5bcf098ae37dc9 with 86% similarity]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/99/f0ca4e2e106b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9b/2092e4728a6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9c/c09796a2666b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a/9003368eeb6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a2/209be17eeb6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a4/40c69c5a136b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a4/f03f48f8eb6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a5/40f42873136b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/aa/60880ca7e86500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bb/60e0098b0e6b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b0b49a548b6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b0de668c166b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bb/e02a3d87646b001115b7b82f2f4ce01a [moved from workspace/.metadata/.plugins/org.eclipse.core.resources/.history/22/f02166ebe96500111e5bcf098ae37dc9 with 50% similarity]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bd/80845745d46a001115b0ad2bca3cccad [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bd/a0ca78a0f16500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c/30ed9725686b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c1/70cc2ee48a6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c5/7080417b0e6b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c6/10cbb6e8686b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c8/f0a63d728e6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ce/50114f10ec6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d1/e01807fae96500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d4/e0dc6685676b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/e8/10fcce04136b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/e8/b0c70338ea6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/eb/b04bd6a30e6b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ef/702f96cdea6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/f1/90eb7b06eb6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/f7/109715b4136b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/f7/80ac9a0f8b6500111e5bcf098ae37dc9 [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/fe/90892eab136b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ff/80d48880676b001115b7b82f2f4ce01a [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/7e/history.index
workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/8d/history.index
workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/94/history.index
workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/b9/history.index
workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/history.index
workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e8/a8/history.index [deleted file]
workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/properties.index
workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.markers
workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/org.eclipse.jdt.core/state.dat
workspace/.metadata/.plugins/org.eclipse.core.resources/.root/19.tree [moved from workspace/.metadata/.plugins/org.eclipse.core.resources/.root/17.tree with 73% similarity]
workspace/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources
workspace/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml
workspace/.metadata/.plugins/org.eclipse.epp.usagedata.recording/upload1.csv [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.epp.usagedata.recording/upload2.csv [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.epp.usagedata.recording/upload3.csv [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.epp.usagedata.recording/upload4.csv [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.epp.usagedata.recording/usagedata.csv
workspace/.metadata/.plugins/org.eclipse.jdt.core/471433581.index
workspace/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt
workspace/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml
workspace/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml
workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/TrainDelayBot/2012/3/11/refactorings.history [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/TrainDelayBot/2012/3/11/refactorings.index [new file with mode: 0644]
workspace/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log
workspace/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
workspace/TrainDelayBot/src/com/yuji/tdb/db/Train.java [new file with mode: 0644]
workspace/TrainDelayBot/src/com/yuji/tdb/db/TrainDao.java [new file with mode: 0644]
workspace/TrainDelayBot/src/com/yuji/tdb/main/Main.java
workspace/TrainDelayBot/src/com/yuji/tdb/twitter/TwitterUtil.java
workspace/TrainDelayBot/src/com/yuji/tdb/utility/StringUtility.java
workspace/TrainDelayBot/war/WEB-INF/appengine-generated/datastore-indexes-auto.xml [new file with mode: 0644]
workspace/TrainDelayBot/war/WEB-INF/appengine-generated/local_db.bin

index 605f0cf..1eccaa6 100644 (file)
--- a/memo.txt
+++ b/memo.txt
@@ -39,20 +39,4 @@ http://1.latest.traindelaybot.appspot.com/traindelaybot
 
 
 \81\9bBigTable
-http://www.atmarkit.co.jp/fjava/rensai4/gaej03/gaej03_4.html
-
-
-\82P\82Q\82R\82S\82T\82U\82V\82W\82X\82O
-\82P\82Q\82R\82S\82T\82U\82V\82W\82X\82O
-\82P\82Q\82R\82S\82T\82U\82V\82W\82X\82O
-\82P\82Q\82R\82S\82T\82U\82V\82W\82X\82O
-\82P\82Q\82R\82S\82T\82U\82V\82W\82X\82O
-\82P\82Q\82R\82S\82T\82U\82V\82W\82X\82O
-\82P\82Q\82R\82S\82T\82U\82V\82W\82X\82O
-\82P\82Q\82R\82S\82T\82U\82V\82W\82X\82O
-\82P\82Q\82R\82S\82T\82U\82V\82W\82X\82O
-\82P\82Q\82R\82S\82T\82U\82V\82W\82X\82O
-\82P\82Q\82R\82S\82T\82U\82V\82W\82X\82O
-\82P\82Q\82R\82S\82T\82U\82V\82W\82X\82O
-\82P\82Q\82R\82S\82T\82U\82V\82W\82X\82O
-\82P\82Q\82R\82S\82T\82U\82V\82W\82X\82O
+http://www.atmarkit.co.jp/fjava/rensai4/gaej02/gaej02_3.html
index 996857d..a74b337 100644 (file)
@@ -3010,3 +3010,65 @@ Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.
 
 !ENTRY org.eclipse.epp.usagedata.recording 1 0 2012-03-11 00:51:39.321
 !MESSAGE Usage data uploaded to http://udc.eclipse.org/upload.php in 18624 milliseconds.
+!SESSION 2012-03-11 02:07:47.685 -----------------------------------------------
+eclipse.buildId=I20110613-1736
+java.version=1.6.0_29
+java.vendor=Apple Inc.
+BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=ja_JP
+Framework arguments:  -product org.eclipse.epp.package.java.product -keyring /Users/yuji/.eclipse_keyring -showlocation
+Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product -keyring /Users/yuji/.eclipse_keyring -showlocation
+
+!ENTRY org.eclipse.core.net 1 0 2012-03-11 02:08:12.409
+!MESSAGE System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences
+
+!ENTRY com.google.gwt.eclipse.core 2 0 2012-03-11 02:09:13.749
+!MESSAGE Could not check whether the launch configuration "Test" needs the -XstartOnFirstThread argument, assuming it does
+
+!ENTRY com.google.gwt.eclipse.core 2 0 2012-03-11 02:09:14.161
+!MESSAGE Could not check whether the launch configuration "Test" needs the -XstartOnFirstThread argument, assuming it does
+
+!ENTRY com.google.gwt.eclipse.core 2 0 2012-03-11 02:09:14.194
+!MESSAGE Could not check whether the launch configuration "TrainDelayBot" needs the -XstartOnFirstThread argument, assuming it does
+
+!ENTRY com.google.gwt.eclipse.core 2 0 2012-03-11 02:09:14.205
+!MESSAGE Could not check whether the launch configuration "TrainDelayBot" needs the -XstartOnFirstThread argument, assuming it does
+!SESSION 2012-03-11 09:03:56.427 -----------------------------------------------
+eclipse.buildId=I20110613-1736
+java.version=1.6.0_29
+java.vendor=Apple Inc.
+BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=ja_JP
+Framework arguments:  -product org.eclipse.epp.package.java.product -keyring /Users/yuji/.eclipse_keyring -showlocation
+Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product -keyring /Users/yuji/.eclipse_keyring -showlocation
+
+!ENTRY org.eclipse.core.net 1 0 2012-03-11 09:07:20.684
+!MESSAGE System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences
+
+!ENTRY com.google.gwt.eclipse.core 2 0 2012-03-11 09:07:41.164
+!MESSAGE Could not check whether the launch configuration "Test" needs the -XstartOnFirstThread argument, assuming it does
+
+!ENTRY com.google.gwt.eclipse.core 2 0 2012-03-11 09:07:41.345
+!MESSAGE Could not check whether the launch configuration "Test" needs the -XstartOnFirstThread argument, assuming it does
+
+!ENTRY com.google.gwt.eclipse.core 2 0 2012-03-11 09:07:41.356
+!MESSAGE Could not check whether the launch configuration "TrainDelayBot" needs the -XstartOnFirstThread argument, assuming it does
+
+!ENTRY com.google.gwt.eclipse.core 2 0 2012-03-11 09:07:41.379
+!MESSAGE Could not check whether the launch configuration "TrainDelayBot" needs the -XstartOnFirstThread argument, assuming it does
+
+!ENTRY com.google.appengine.eclipse.core 1 0 2012-03-11 09:49:27.342
+!MESSAGE TrainDelayBot successfully deployed to Google App Engine
+
+!ENTRY com.google.gdt.eclipse.managedapis 1 0 2012-03-11 12:38:15.560
+!MESSAGE Failed to load icon cache
+
+!ENTRY com.google.gdt.eclipse.managedapis 1 0 2012-03-11 14:38:34.502
+!MESSAGE Failed to load icon cache
+
+!ENTRY com.google.gdt.eclipse.managedapis 1 0 2012-03-11 16:38:53.520
+!MESSAGE Failed to load icon cache
+
+!ENTRY com.google.gdt.eclipse.managedapis 1 0 2012-03-11 18:39:12.552
+!MESSAGE Failed to load icon cache
+
+!ENTRY com.google.appengine.eclipse.core 1 0 2012-03-11 20:03:35.906
+!MESSAGE TrainDelayBot successfully deployed to Google App Engine
index 4ea9f81..6173663 100644 (file)
Binary files a/workspace/.metadata/.mylyn/.tasks.xml.zip and b/workspace/.metadata/.mylyn/.tasks.xml.zip differ
index 926bc8a..bc70ade 100644 (file)
Binary files a/workspace/.metadata/.mylyn/tasks.xml.zip and b/workspace/.metadata/.mylyn/tasks.xml.zip differ
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/0/80d0300c106b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/0/80d0300c106b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..d7af4cb
--- /dev/null
@@ -0,0 +1,54 @@
+package com.yuji.tdb.utility;
+
+import java.util.regex.Pattern;
+
+public class StringUtility {
+       private static Pattern ptnAlnum = Pattern.compile("[a-zA-Z0-9]");
+       private static Pattern ptnSpace = Pattern.compile("\\s");
+       private static Pattern ptnAscii = Pattern.compile("\\p{ASCII}");
+       
+       public static String parseSubstring(String text, int length){
+               int len = text.length();
+               int status = -1;
+               int pos = 0;
+               
+               for (int i = 0; i < len + 1 && i < length + 1; i++){
+                       if (i >= len){
+                               pos = i;
+                               break;
+                       }
+                       String ch = text.substring(i, i + 1);
+                       
+                       if (ptnAlnum.matcher(ch).matches()){
+                               if (status != 0){
+                                       if (status != 1){
+                                               pos = i;
+                                       }
+                                       status = 0;
+                               }
+                       }
+                       else if (ptnSpace.matcher(ch).matches()){
+                               if (status != 1){
+                                       pos = i;
+                                       status = 1;
+                               }
+                       }
+                       else if (ptnAscii.matcher(ch).matches()){
+                               if (status != 2){
+                                       if (status != 1){
+                                               pos = i;
+                                       }
+                                       status = 2;
+                               }                               
+                       }
+                       else {
+                               pos = i;
+                               status = 3;
+                       }
+               }
+               if (pos == 0){
+                       return text.substring(0, (len < length)? len : length);                 
+               }
+               return text.substring(0, pos);
+       }
+}
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/12/007d7e77666b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/12/007d7e77666b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..11e9e21
--- /dev/null
@@ -0,0 +1,37 @@
+package com.yuji.tdb.db;\r
+\r
+import java.util.List;\r
+\r
+import javax.jdo.PersistenceManager;\r
+\r
+public class TrainDao {\r
+       private static TrainDao instance = null;\r
+       private PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
+\r
+       public static TrainDao getInstance() {\r
+               if (instance == null) {\r
+                       instance = new TrainDao();\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TrainDao() {\r
+\r
+       }\r
+\r
+       public List<Train> search() {\r
+               String query = "SELECT FROM " + Train.class.getName();\r
+               List<Train> list = (List<Train>) pm.newQuery(query).execute();\r
+               pm.close();\r
+               return list;\r
+       }\r
+\r
+       public void put(String key, String value) {\r
+               KeyValue keyValue = new KeyValue(key, value);\r
+               pm.makePersistent(keyValue);\r
+       }\r
+\r
+       public void put(String key, int value) {\r
+               put(key, String.valueOf(value));\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/12/50ffd5cf666b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/12/50ffd5cf666b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..568f2b7
--- /dev/null
@@ -0,0 +1,149 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.TimeZone;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+               //TimeZone.setDefault(TimeZone.getTimeZone("JST")); // TODO \8fê\8f\8a\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       twite(text, twitter);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+\r
+       private void twite(String text, Twitter twitter) throws TwitterException {\r
+               Calendar cal = Calendar.getInstance();\r
+               Date date = cal.getTime();\r
+               long cur = date.getTime();\r
+               \r
+               Query query = new Query();\r
+               //query.setRpp(1000); // TODO\r
+               query.setQuery(text);\r
+               QueryResult result = twitter.search(query);\r
+               List<Tweet> tweets = result.getTweets();\r
+               \r
+               int count = 0;\r
+               int hit = 0;\r
+               int mhit = 0;\r
+               \r
+               int index;\r
+               int mindex = 0;\r
+               int size = tweets.size();\r
+               for (index = 0; index < size; index++) {\r
+                       Tweet tweet = tweets.get(index);\r
+                       \r
+                       Date at = tweet.getCreatedAt();\r
+                       long t = at.getTime();\r
+                       \r
+                       String message = tweet.getText();\r
+                       \r
+                       if (t < cur - 30 * 60 * 1000){\r
+                               System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               continue;\r
+                       }\r
+                       hit = filter(message);\r
+                       if (hit <= 0) {\r
+                               // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                               continue;\r
+                       }\r
+                       if (hit > mhit){\r
+                               hit = mhit;\r
+                               mindex = index;\r
+                       }\r
+\r
+                       System.out.println("@" + tweet.getFromUser() + " - "\r
+                                       + tweet.getText() + at);\r
+                       count++;\r
+               }\r
+\r
+               String message = "";\r
+               if (count < 5){\r
+                       message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+               }\r
+               else {\r
+                       int N = 100;\r
+                       \r
+                       String sample = tweets.get(mindex).getText();\r
+                       sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                       sample = StringUtility.parseSubstring(sample, N);\r
+                       message = sample + " " + df.format(date) + " count=" + count;                                                   \r
+               }\r
+               System.out.println(message); //TODO\r
+               Status status = twitter.updateStatus(message); //TODO\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/16/306ca0980e6b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/16/306ca0980e6b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..14ef6fe
--- /dev/null
@@ -0,0 +1,46 @@
+package com.yuji.tdb.main;\r
+\r
+import twitter4j.Status;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class Main {\r
+\r
+       public static void main(String[] args) {\r
+               test1();\r
+       }\r
+       \r
+       public static void test1(){\r
+               String text = "\82 \82¢ \82¤\82¦\82¨";\r
+               int length = 4;\r
+               String ret = StringUtility.parseSubstring(text, length);\r
+               System.out.println(ret);\r
+       }\r
+\r
+       public static void main() {\r
+               String consumerKey = "";\r
+               String consumerSecret = "";\r
+               String tokenKey = "";\r
+               String tokenSecret = "";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+\r
+                       AccessToken accessToken = new AccessToken(tokenKey, tokenSecret);\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Status status = twitter.updateStatus("\83e\83X\83g");\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+               }\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/1a/c0baa0888b6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/1a/c0baa0888b6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index a1aca32..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               resp.setContentType("text/plain");\r
-               resp.getWriter().println("traindelaybot Hello, world");\r
-\r
-               String parmConsumerKey = req.getParameter("key");\r
-               String parmConsumerSecret = req.getParameter("secret");\r
-               String parmResult = req.getParameter("result");\r
-               if (!CommonUtil.isNull(parmConsumerKey)\r
-                               && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                       setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                       parmConsumerSecret);\r
-                       return;\r
-               }\r
-\r
-               if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                               || CommonUtil.isNull(consumerSecret)) {\r
-                       return;\r
-               }\r
-\r
-               if (!CommonUtil.isNull(parmResult)) {\r
-                       resultOAuthAuthorization();\r
-                       return;\r
-               }\r
-\r
-               TwitterUtil util = TwitterUtil.getInstance();\r
-               util.main(consumerKey, consumerSecret, accessToken);\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/1b/10fe5b37106b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/1b/10fe5b37106b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..fb4e8d7
--- /dev/null
@@ -0,0 +1,46 @@
+package com.yuji.tdb.main;\r
+\r
+import twitter4j.Status;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class Main {\r
+\r
+       public static void main(String[] args) {\r
+               test1();\r
+       }\r
+       \r
+       public static void test1(){\r
+               String text = "\82 \82¢ bb cc";\r
+               int length = 3;\r
+               String ret = StringUtility.parseSubstring(text, length);\r
+               System.out.println(ret);\r
+       }\r
+\r
+       public static void main() {\r
+               String consumerKey = "";\r
+               String consumerSecret = "";\r
+               String tokenKey = "";\r
+               String tokenSecret = "";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+\r
+                       AccessToken accessToken = new AccessToken(tokenKey, tokenSecret);\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Status status = twitter.updateStatus("\83e\83X\83g");\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+               }\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/1f/70c5ac3c106b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/1f/70c5ac3c106b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..4c54553
--- /dev/null
@@ -0,0 +1,46 @@
+package com.yuji.tdb.main;\r
+\r
+import twitter4j.Status;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class Main {\r
+\r
+       public static void main(String[] args) {\r
+               test1();\r
+       }\r
+       \r
+       public static void test1(){\r
+               String text = "\82 \82¢ bb cc";\r
+               int length = 2;\r
+               String ret = StringUtility.parseSubstring(text, length);\r
+               System.out.println(ret);\r
+       }\r
+\r
+       public static void main() {\r
+               String consumerKey = "";\r
+               String consumerSecret = "";\r
+               String tokenKey = "";\r
+               String tokenSecret = "";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+\r
+                       AccessToken accessToken = new AccessToken(tokenKey, tokenSecret);\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Status status = twitter.updateStatus("\83e\83X\83g");\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+               }\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/20/308671088c6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/20/308671088c6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index dc1daf3..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               resp.setContentType("text/plain");\r
-               resp.getWriter().println("traindelaybot Hello, world");\r
-\r
-               String parmConsumerKey = req.getParameter("key");\r
-               String parmConsumerSecret = req.getParameter("secret");\r
-               String parmResult = req.getParameter("result");\r
-               if (!CommonUtil.isNull(parmConsumerKey)\r
-                               && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                       setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                       parmConsumerSecret);\r
-                       return;\r
-               }\r
-\r
-               if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                               || CommonUtil.isNull(consumerSecret)) {\r
-                       return;\r
-               }\r
-\r
-               if (!CommonUtil.isNull(parmResult)) {\r
-                       resultOAuthAuthorization();\r
-                       return;\r
-               }\r
-\r
-               if (accessToken == null){\r
-                       return;\r
-               }\r
-               \r
-               TwitterUtil util = TwitterUtil.getInstance();\r
-               util.main(consumerKey, consumerSecret, accessToken);\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/26/c007379f136b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/26/c007379f136b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..2e1f465
--- /dev/null
@@ -0,0 +1,143 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Calendar cal = Calendar.getInstance();\r
+                       Date date = cal.getTime();\r
+                       long cur = date.getTime();\r
+                       \r
+                       Query query = new Query();\r
+                       //query.setRpp(1000); // TODO\r
+                       query.setQuery(text);\r
+                       QueryResult result = twitter.search(query);\r
+                       List<Tweet> tweets = result.getTweets();\r
+                       \r
+                       int count = 0;\r
+                       int hit = 0;\r
+                       int mhit = 0;\r
+                       \r
+                       int index;\r
+                       int mindex = 0;\r
+                       int size = tweets.size();\r
+                       for (index = 0; index < size; index++) {\r
+                               Tweet tweet = tweets.get(index);\r
+                               \r
+                               Date at = tweet.getCreatedAt();\r
+                               long t = at.getTime();\r
+                               \r
+                               String message = tweet.getText();\r
+                               \r
+                               if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
+                                       continue;\r
+                               }\r
+                               hit = filter(message);\r
+                               if (hit <= 0) {\r
+                                       // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                                       continue;\r
+                               }\r
+                               if (hit > mhit){\r
+                                       hit = mhit;\r
+                                       mindex = index;\r
+                               }\r
+\r
+                               System.out.println("@" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               count++;\r
+                       }\r
+               \r
+                       String message = "";\r
+                       if (count < 5){\r
+                               message = "\92x\89\84\82È\82µ " + DateFormat.format(date);        \r
+                       }\r
+                       else {\r
+                               int N = 100;\r
+                               \r
+                               String sample = tweets.get(mindex).getText();\r
+                               sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
+                               message = sample + " " + date.toString() + " count=" + count;                                                   \r
+                       }\r
+                       System.out.println(message);//TODO\r
+                       Status status = twitter.updateStatus(message);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/2c/a09dafda8a6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/2c/a09dafda8a6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 2722cea..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               resp.setContentType("text/plain");\r
-               resp.getWriter().println(" traindelaybot Hello, world");\r
-\r
-               String parmConsumerKey = req.getParameter("key");\r
-               String consumerSecret = req.getParameter("secret");\r
-               String result = req.getParameter("result");\r
-               if (!CommonUtil.isNull(parmConsumerKey)\r
-                               && !CommonUtil.isNull(consumerSecret)) {\r
-                       setOAuthAuthorization(req, resp, parmConsumerKey, consumerSecret);\r
-                       return;\r
-               }\r
-\r
-               if (requestToken == null\r
-                               || CommonUtil.isNull(TrainDelayBotServlet.consumerKey)\r
-                               || CommonUtil.isNull(TrainDelayBotServlet.consumerSecret)) {\r
-                       return;\r
-               }\r
-\r
-               if (!CommonUtil.isNull(result)) {\r
-                       resultOAuthAuthorization();\r
-                       return;\r
-               }\r
-\r
-               // TODO null check\r
-               TwitterUtil util = TwitterUtil.getInstance();\r
-               util.main(TrainDelayBotServlet.consumerKey,\r
-                               TrainDelayBotServlet.consumerSecret, accessToken);\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String consumerKey, String consumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(consumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(consumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       TrainDelayBotServlet.consumerKey = consumerKey;\r
-                       TrainDelayBotServlet.consumerSecret = consumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/2e/80e83f5b8b6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/2e/80e83f5b8b6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 7d06eac..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               resp.setContentType("text/plain");\r
-               resp.getWriter().println(" traindelaybot Hello, world");\r
-\r
-               String parmConsumerKey = req.getParameter("key");\r
-               String parmConsumerSecret = req.getParameter("secret");\r
-               String parmResult = req.getParameter("result");\r
-               if (!CommonUtil.isNull(parmConsumerKey)\r
-                               && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                       setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                       parmConsumerSecret);\r
-                       return;\r
-               }\r
-\r
-               if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                               || CommonUtil.isNull(consumerSecret)) {\r
-                       return;\r
-               }\r
-\r
-               if (!CommonUtil.isNull(parmResult)) {\r
-                       resultOAuthAuthorization();\r
-                       return;\r
-               }\r
-\r
-               // TODO null check\r
-               TwitterUtil util = TwitterUtil.getInstance();\r
-               util.main(consumerKey, consumerSecret, accessToken);\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/31/40ea2621906500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/31/40ea2621906500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 9539828..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-import java.util.logging.Logger;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       private static final Logger log = Logger\r
-                       .getLogger(TrainDelayBotServlet.class.getName());\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               try {\r
-                       log.info("start");\r
-                       \r
-                       resp.setContentType("text/plain");\r
-                       resp.getWriter().println("<h3>traindelaybot Hello, world</h3>");\r
-\r
-                       String parmConsumerKey = req.getParameter("key");\r
-                       String parmConsumerSecret = req.getParameter("secret");\r
-                       String parmResult = req.getParameter("result");\r
-                       if (!CommonUtil.isNull(parmConsumerKey)\r
-                                       && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                               setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                               parmConsumerSecret);\r
-                               return;\r
-                       }\r
-\r
-                       if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                                       || CommonUtil.isNull(consumerSecret)) {\r
-                               log.warning("001");\r
-                               return;\r
-                       }\r
-\r
-                       if (!CommonUtil.isNull(parmResult)) {\r
-                               resultOAuthAuthorization();\r
-                               return;\r
-                       }\r
-\r
-                       if (accessToken == null) {\r
-                               log.warning("002");\r
-                               return;\r
-                       }\r
-\r
-                       TwitterUtil util = TwitterUtil.getInstance();\r
-                       util.main(consumerKey, consumerSecret, accessToken);\r
-               } finally {\r
-                       log.info("end");\r
-               }\r
-\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/31/5021e69b0e6b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/31/5021e69b0e6b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..9be18d3
--- /dev/null
@@ -0,0 +1,46 @@
+package com.yuji.tdb.main;\r
+\r
+import twitter4j.Status;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class Main {\r
+\r
+       public static void main(String[] args) {\r
+               test1();\r
+       }\r
+       \r
+       public static void test1(){\r
+               String text = "aa bb cc";\r
+               int length = 4;\r
+               String ret = StringUtility.parseSubstring(text, length);\r
+               System.out.println(ret);\r
+       }\r
+\r
+       public static void main() {\r
+               String consumerKey = "";\r
+               String consumerSecret = "";\r
+               String tokenKey = "";\r
+               String tokenSecret = "";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+\r
+                       AccessToken accessToken = new AccessToken(tokenKey, tokenSecret);\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Status status = twitter.updateStatus("\83e\83X\83g");\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+               }\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/31/90efe23dee6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/31/90efe23dee6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index d4c68a4..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-import java.util.logging.Logger;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.db.KeyValueDao;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static final Logger log = Logger\r
-                       .getLogger(TrainDelayBotServlet.class.getName());\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       private KeyValueDao dao = KeyValueDao.getInstance();\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               try {\r
-                       log.info("start");\r
-                       \r
-                       resp.setContentType("text/plain");\r
-                       resp.getWriter().println("<h3>traindelaybot Hello, world</h3>");\r
-\r
-                       String parmConsumerKey = req.getParameter("key");\r
-                       String parmConsumerSecret = req.getParameter("secret");\r
-                       String parmResult = req.getParameter("result");\r
-                       if (!CommonUtil.isNull(parmConsumerKey)\r
-                                       && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                               setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                               parmConsumerSecret);\r
-                               \r
-                               dao.put("FOO", "aaa");\r
-                               \r
-                               return;\r
-                       }\r
-\r
-                       if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                                       || CommonUtil.isNull(consumerSecret)) {\r
-                               log.warning("001");\r
-                               return;\r
-                       }\r
-\r
-                       if (!CommonUtil.isNull(parmResult)) {\r
-                               resultOAuthAuthorization();\r
-                               \r
-                               String value = dao.get("FOO");\r
-                               log.warning("VALUE=" + value);\r
-                               \r
-                               return;\r
-                       }\r
-\r
-                       if (accessToken == null) {\r
-                               log.warning("002");\r
-                               return;\r
-                       }\r
-\r
-                       TwitterUtil util = TwitterUtil.getInstance();\r
-                       util.main(consumerKey, consumerSecret, accessToken);\r
-               } finally {\r
-                       log.info("end");\r
-               }\r
-\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               }\r
-       }\r
-}\r
@@ -17,6 +17,7 @@ import twitter4j.auth.AccessToken;
 import twitter4j.conf.ConfigurationBuilder;\r
 \r
 import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
 \r
 public class TwitterUtil {\r
        private static final Logger log = Logger\r
@@ -55,7 +56,7 @@ public class TwitterUtil {
                        long cur = date.getTime();\r
                        \r
                        Query query = new Query();\r
-                       query.setRpp(100); // TODO\r
+                       //query.setRpp(1000); // TODO\r
                        query.setQuery(text);\r
                        QueryResult result = twitter.search(query);\r
                        List<Tweet> tweets = result.getTweets();\r
@@ -72,9 +73,12 @@ public class TwitterUtil {
                                \r
                                Date at = tweet.getCreatedAt();\r
                                long t = at.getTime();\r
+                               \r
                                String message = tweet.getText();\r
                                \r
                                if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
                                        continue;\r
                                }\r
                                hit = filter(message);\r
@@ -97,13 +101,11 @@ public class TwitterUtil {
                                message = "\92x\89\84\82È\82µ " + date.toString();                        \r
                        }\r
                        else {\r
-                               int N = 50;\r
+                               int N = 100;\r
                                \r
                                String sample = tweets.get(mindex).getText();\r
-                               if (sample.length() > N){\r
-                                       sample = sample.substring(0, N);\r
-                               }\r
                                sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
                                message = sample + " " + date.toString() + " count=" + count;                                                   \r
                        }\r
                        Status status = twitter.updateStatus(message);\r
@@ -122,7 +124,9 @@ public class TwitterUtil {
                        keywords.add("\92x\89\84");\r
                        keywords.add("\92x\82ê");\r
                        keywords.add("\90U\82è\91Ö\82¦");\r
-                       keywords.add("\8bÙ\8b}\92â\8e~");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
                }\r
 \r
                int count = 0;\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/38/5033ef01d46a001115b0ad2bca3cccad b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/38/5033ef01d46a001115b0ad2bca3cccad
new file mode 100644 (file)
index 0000000..99580d4
--- /dev/null
@@ -0,0 +1,43 @@
+package com.yuji.tdb.utility;
+
+import java.util.regex.Pattern;
+
+public class StringUtility {
+       private static Pattern ptnAlnum = Pattern.compile("[a-zA-Z0-9]");
+       private static Pattern ptnAscii = Pattern.compile("\\p{ASCII}");
+       
+       public static String parseSubstring(String text, int length){
+               int len = text.length();
+               int status = -1;
+               int pos = 0;
+               
+               for (int i = 0; i < len + 1 && i < length + 1; i++){
+                       if (i >= len){
+                               pos = i;
+                               break;
+                       }
+                       String ch = text.substring(i, i + 1);
+                       
+                       if (ptnAlnum.matcher(ch).matches()){
+                               if (status != 0){
+                                       pos = i;
+                                       status = 0;
+                               }
+                       }
+                       else if (ptnAscii.matcher(ch).matches()){
+                               if (status != 1){
+                                       pos = i;
+                                       status = 1;
+                               }                               
+                       }
+                       else {
+                               pos = i;
+                               status = 2;
+                       }
+               }
+               if (pos == 0){
+                       return text.substring(0, (len < length)? len : length);                 
+               }
+               return text.substring(0, pos);
+       }
+}
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/3b/302290e7646b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/3b/302290e7646b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..ad62c72
--- /dev/null
@@ -0,0 +1,48 @@
+package com.yuji.tdb.db;\r
+\r
+import javax.jdo.PersistenceManager;\r
+\r
+public class TrainDao {\r
+       public static final String KEY_CONSUMER_KEY = "CONSUMER_KEY";\r
+       public static final String KEY_CONSUMER_SECRET = "CONSUMER_SECRET";\r
+       public static final String KEY_REQUEST_TOKEN = "REQUEST_TOKEN";\r
+       public static final String KEY_REQUEST_TOKEN_SECRET = "REQUEST_TOKEN_SECRET";\r
+       public static final String KEY_ACCESS_TOKEN = "ACCESS_TOKEN";\r
+       public static final String KEY_ACCESS_TOKEN_SECRET = "ACCESS_TOKEN_SECRET";\r
+\r
+       private static TrainDao instance = null;\r
+       private PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
+               \r
+       public static TrainDao getInstance(){\r
+               if (instance == null){\r
+                       instance = new TrainDao();\r
+               }\r
+               return instance;\r
+       }\r
+       \r
+       private TrainDao(){\r
+               \r
+       }\r
+       \r
+       public String get(String key){\r
+               KeyValue keyValue = pm.getObjectById(KeyValue.class, key);\r
+               if (keyValue == null){\r
+                       return null;\r
+               }\r
+               return keyValue.getValue();\r
+       }\r
+       \r
+       public int getInt(String key){\r
+               String value = get(key);\r
+               return Integer.valueOf(value).intValue();\r
+       }\r
+       \r
+       public void put(String key, String value){\r
+               KeyValue keyValue = new KeyValue(key, value);\r
+               pm.makePersistent(keyValue);\r
+       }\r
+\r
+       public void put(String key, int value){\r
+               put(key, String.valueOf(value));\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/3b/e0dcd1aa0e6b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/3b/e0dcd1aa0e6b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..9be18d3
--- /dev/null
@@ -0,0 +1,46 @@
+package com.yuji.tdb.main;\r
+\r
+import twitter4j.Status;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class Main {\r
+\r
+       public static void main(String[] args) {\r
+               test1();\r
+       }\r
+       \r
+       public static void test1(){\r
+               String text = "aa bb cc";\r
+               int length = 4;\r
+               String ret = StringUtility.parseSubstring(text, length);\r
+               System.out.println(ret);\r
+       }\r
+\r
+       public static void main() {\r
+               String consumerKey = "";\r
+               String consumerSecret = "";\r
+               String tokenKey = "";\r
+               String tokenSecret = "";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+\r
+                       AccessToken accessToken = new AccessToken(tokenKey, tokenSecret);\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Status status = twitter.updateStatus("\83e\83X\83g");\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+               }\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/3c/30250be8eb6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/3c/30250be8eb6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index e3e99a5..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-import java.util.logging.Logger;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.db.KeyValueDao;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static final Logger log = Logger\r
-                       .getLogger(TrainDelayBotServlet.class.getName());\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               try {\r
-                       log.info("start");\r
-                       \r
-                       KeyValueDao dao = KeyValueDao.getInstance();\r
-                       \r
-                       resp.setContentType("text/plain");\r
-                       resp.getWriter().println("<h3>traindelaybot Hello, world</h3>");\r
-\r
-                       String parmConsumerKey = req.getParameter("key");\r
-                       String parmConsumerSecret = req.getParameter("secret");\r
-                       String parmResult = req.getParameter("result");\r
-                       if (!CommonUtil.isNull(parmConsumerKey)\r
-                                       && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                               setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                               parmConsumerSecret);\r
-                               \r
-                               \r
-                               return;\r
-                       }\r
-\r
-                       if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                                       || CommonUtil.isNull(consumerSecret)) {\r
-                               log.warning("001");\r
-                               return;\r
-                       }\r
-\r
-                       if (!CommonUtil.isNull(parmResult)) {\r
-                               resultOAuthAuthorization();\r
-                               return;\r
-                       }\r
-\r
-                       if (accessToken == null) {\r
-                               log.warning("002");\r
-                               return;\r
-                       }\r
-\r
-                       TwitterUtil util = TwitterUtil.getInstance();\r
-                       util.main(consumerKey, consumerSecret, accessToken);\r
-               } finally {\r
-                       log.info("end");\r
-               }\r
-\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/42/b0c6c14d8b6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/42/b0c6c14d8b6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 8bbfc9f..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               resp.setContentType("text/plain");\r
-               resp.getWriter().println(" traindelaybot Hello, world");\r
-\r
-               String parmConsumerKey = req.getParameter("key");\r
-               String parmConsumerSecret = req.getParameter("secret");\r
-               String parmResult = req.getParameter("result");\r
-               if (!CommonUtil.isNull(parmConsumerKey)\r
-                               && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                       setOAuthAuthorization(req, resp, parmConsumerKey, parmConsumerSecret);\r
-                       return;\r
-               }\r
-\r
-               if (requestToken == null\r
-                               || CommonUtil.isNull(consumerKey)\r
-                               || CommonUtil.isNull(consumerSecret)) {\r
-                       return;\r
-               }\r
-\r
-               if (!CommonUtil.isNull(parmResult)) {\r
-                       resultOAuthAuthorization();\r
-                       return;\r
-               }\r
-\r
-               // TODO null check\r
-               TwitterUtil util = TwitterUtil.getInstance();\r
-               util.main(consumerKey,\r
-                               consumerSecret, accessToken);\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String pramConsumerKey, String consumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(pramConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(consumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       TrainDelayBotServlet.consumerKey = pramConsumerKey;\r
-                       TrainDelayBotServlet.consumerSecret = consumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/45/204c2062136b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/45/204c2062136b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..2e1f465
--- /dev/null
@@ -0,0 +1,143 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Calendar cal = Calendar.getInstance();\r
+                       Date date = cal.getTime();\r
+                       long cur = date.getTime();\r
+                       \r
+                       Query query = new Query();\r
+                       //query.setRpp(1000); // TODO\r
+                       query.setQuery(text);\r
+                       QueryResult result = twitter.search(query);\r
+                       List<Tweet> tweets = result.getTweets();\r
+                       \r
+                       int count = 0;\r
+                       int hit = 0;\r
+                       int mhit = 0;\r
+                       \r
+                       int index;\r
+                       int mindex = 0;\r
+                       int size = tweets.size();\r
+                       for (index = 0; index < size; index++) {\r
+                               Tweet tweet = tweets.get(index);\r
+                               \r
+                               Date at = tweet.getCreatedAt();\r
+                               long t = at.getTime();\r
+                               \r
+                               String message = tweet.getText();\r
+                               \r
+                               if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
+                                       continue;\r
+                               }\r
+                               hit = filter(message);\r
+                               if (hit <= 0) {\r
+                                       // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                                       continue;\r
+                               }\r
+                               if (hit > mhit){\r
+                                       hit = mhit;\r
+                                       mindex = index;\r
+                               }\r
+\r
+                               System.out.println("@" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               count++;\r
+                       }\r
+               \r
+                       String message = "";\r
+                       if (count < 5){\r
+                               message = "\92x\89\84\82È\82µ " + DateFormat.format(date);        \r
+                       }\r
+                       else {\r
+                               int N = 100;\r
+                               \r
+                               String sample = tweets.get(mindex).getText();\r
+                               sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
+                               message = sample + " " + date.toString() + " count=" + count;                                                   \r
+                       }\r
+                       System.out.println(message);//TODO\r
+                       Status status = twitter.updateStatus(message);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/45/c0c9b7d4eb6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/45/c0c9b7d4eb6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index f8d84ce..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.yuji.tdb.db;\r
-\r
-import javax.jdo.PersistenceManager;\r
-\r
-public class KeyValueDao {\r
-       private static KeyValueDao instance = null;\r
-       \r
-       public static KeyValueDao getInstance(){\r
-               if (instance == null){\r
-                       instance = new KeyValueDao();\r
-               }\r
-               return instance;\r
-       }\r
-       \r
-       private PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
-       \r
-       public String get(String key){\r
-               KeyValue keyValue = pm.getObjectById(KeyValue.class, key);\r
-               if (keyValue == null){\r
-                       return null;\r
-               }\r
-               return keyValue.getValue();\r
-       }\r
-       \r
-       public void put(String key, String value){\r
-               KeyValue keyValue = new KeyValue(key, value);\r
-               pm.makePersistent(keyValue);\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/46/f0fab198676b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/46/f0fab198676b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..11d6fd7
--- /dev/null
@@ -0,0 +1,170 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.db.Train;\r
+import com.yuji.tdb.db.TrainDao;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+               //TimeZone.setDefault(TimeZone.getTimeZone("JST")); // TODO \8fê\8f\8a\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       List<Train> list = getTrainList();\r
+                       for (Train train : list){\r
+                               twite(twitter, train);\r
+                       }\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+\r
+       private void twite(Twitter twitter, Train train) throws TwitterException {\r
+               Calendar cal = Calendar.getInstance();\r
+               Date date = cal.getTime();\r
+               long cur = date.getTime();\r
+               \r
+               Query query = new Query();\r
+               //query.setRpp(1000); // TODO\r
+               query.setQuery(text);\r
+               QueryResult result = twitter.search(query);\r
+               List<Tweet> tweets = result.getTweets();\r
+               \r
+               int count = 0;\r
+               int hit = 0;\r
+               int mhit = 0;\r
+               \r
+               int index;\r
+               int mindex = 0;\r
+               int size = tweets.size();\r
+               for (index = 0; index < size; index++) {\r
+                       Tweet tweet = tweets.get(index);\r
+                       \r
+                       Date at = tweet.getCreatedAt();\r
+                       long t = at.getTime();\r
+                       \r
+                       String message = tweet.getText();\r
+                       \r
+                       if (t < cur - 30 * 60 * 1000){\r
+                               System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               continue;\r
+                       }\r
+                       hit = filter(message);\r
+                       if (hit <= 0) {\r
+                               // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                               continue;\r
+                       }\r
+                       if (hit > mhit){\r
+                               hit = mhit;\r
+                               mindex = index;\r
+                       }\r
+\r
+                       System.out.println("@" + tweet.getFromUser() + " - "\r
+                                       + tweet.getText() + at);\r
+                       count++;\r
+               }\r
+\r
+               String message = "";\r
+               if (count < 5){\r
+                       message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+               }\r
+               else {\r
+                       int N = 100;\r
+                       \r
+                       String sample = tweets.get(mindex).getText();\r
+                       sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                       sample = StringUtility.parseSubstring(sample, N);\r
+                       message = sample + " " + df.format(date) + " count=" + count;                                                   \r
+               }\r
+               System.out.println(message); //TODO\r
+               Status status = twitter.updateStatus(message); //TODO\r
+       }\r
+       \r
+       private List<Train> getTrainList(){\r
+               TrainDao dao = TrainDao.getInstance();\r
+               List<Train> list = dao.search();\r
+               if (list.size() <= 0){\r
+                       Train train;\r
+                       \r
+                       train = new Train("\8b\9e\95l\93\8c\96k\90ü", "\8b\9e\95l\93\8c\96k", 5);\r
+                       list.add(train);\r
+                       train = new Train("\93\8c\8aC\93¹\90ü", "\93\8c\8aC\93¹", 5);\r
+                       list.add(train);\r
+                       train = new Train("\8b\9e\95l\8b}\8ds\90ü", "\8b\9e\8b}", 5);\r
+                       list.add(train);\r
+                       \r
+                       for (Train t : list){\r
+                               dao.put(t);\r
+                       }\r
+               }\r
+               return list;\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/49/20d0d043666b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/49/20d0d043666b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..90d9829
--- /dev/null
@@ -0,0 +1,44 @@
+package com.yuji.tdb.db;\r
+\r
+import javax.jdo.PersistenceManager;\r
+\r
+public class TrainDao {\r
+       private static TrainDao instance = null;\r
+       private PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
+               \r
+       public static TrainDao getInstance(){\r
+               if (instance == null){\r
+                       instance = new TrainDao();\r
+               }\r
+               return instance;\r
+       }\r
+       \r
+       private TrainDao(){\r
+               \r
+       }\r
+       \r
+       public String get(String key){\r
+           String query = "SELECT FROM " + Train.class.getName();\r
+           List<Employee> emp = (List<Employee>) pm.newQuery(query).execute();\r
+            \r
+           if (emp.isEmpty()) {\r
+               out.println("<p>The guestbook has no messages.</p>");\r
+           }else {\r
+               out.println(emp.size() + "\r
+       ");\r
+               for (Employee e : emp) {\r
+                  out.println(e.getName());\r
+               }\r
+           }\r
+           pm.close();\r
+           }\r
+       \r
+       public void put(String key, String value){\r
+               KeyValue keyValue = new KeyValue(key, value);\r
+               pm.makePersistent(keyValue);\r
+       }\r
+\r
+       public void put(String key, int value){\r
+               put(key, String.valueOf(value));\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/4a/400c6497696b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/4a/400c6497696b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..916b64a
--- /dev/null
@@ -0,0 +1,169 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.db.Train;\r
+import com.yuji.tdb.db.TrainDao;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+               //TimeZone.setDefault(TimeZone.getTimeZone("JST")); // TODO \8fê\8f\8a\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       List<Train> list = getTrainList();\r
+                       for (Train train : list){\r
+                               twite(twitter, train);\r
+                       }\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+\r
+       private void twite(Twitter twitter, Train train) throws TwitterException {\r
+               Calendar cal = Calendar.getInstance();\r
+               Date date = cal.getTime();\r
+               long cur = date.getTime();\r
+               \r
+               Query query = new Query();\r
+               //query.setRpp(1000); // TODO\r
+               query.setQuery(train.getSearchWord());\r
+               QueryResult result = twitter.search(query);\r
+               List<Tweet> tweets = result.getTweets();\r
+               \r
+               int count = 0;\r
+               int hit = 0;\r
+               int mhit = 0;\r
+               \r
+               int index;\r
+               int mindex = 0;\r
+               int size = tweets.size();\r
+               for (index = 0; index < size; index++) {\r
+                       Tweet tweet = tweets.get(index);\r
+                       \r
+                       Date at = tweet.getCreatedAt();\r
+                       long t = at.getTime();\r
+                       \r
+                       String message = tweet.getText();\r
+                       \r
+                       if (t < cur - 30 * 60 * 1000){\r
+                               System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               continue;\r
+                       }\r
+                       hit = filter(message);\r
+                       if (hit <= 0) {\r
+                               System.out.println("\81¢" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                               continue;\r
+                       }\r
+                       if (hit > mhit){\r
+                               hit = mhit;\r
+                               mindex = index;\r
+                       }\r
+\r
+                       System.out.println("@" + tweet.getFromUser() + " - "\r
+                                       + tweet.getText() + at);\r
+                       count++;\r
+               }\r
+\r
+               String message = "";\r
+               if (count < train.getCount()){\r
+                       message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+               }\r
+               else {\r
+                       int N = 100;\r
+                       \r
+                       String sample = tweets.get(mindex).getText();\r
+                       sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                       sample = StringUtility.parseSubstring(sample, N);\r
+                       message = sample + " " + df.format(date) + " count=" + count;                                                   \r
+               }\r
+               System.out.println(message); //TODO\r
+               Status status = twitter.updateStatus(message); //TODO\r
+       }\r
+       \r
+       private List<Train> getTrainList(){\r
+               TrainDao dao = TrainDao.getInstance();\r
+               List<Train> list = dao.search();\r
+               if (list.size() <= 0){\r
+                       Train train;\r
+                       \r
+                       train = new Train("\8b\9e\95l\93\8c\96k\90ü", "\8b\9e\95l\93\8c\96k", 5);\r
+                       dao.put(train);\r
+                       train = new Train("\93\8c\8aC\93¹\90ü", "\93\8c\8aC\93¹", 5);\r
+                       dao.put(train);\r
+                       train = new Train("\8b\9e\95l\8b}\8ds\90ü", "\8b\9e\8b}", 5);\r
+                       dao.put(train);\r
+                       list = dao.search();\r
+               }\r
+               return list;\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/4b/4011f0b10e6b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/4b/4011f0b10e6b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..ff3804d
--- /dev/null
@@ -0,0 +1,46 @@
+package com.yuji.tdb.main;\r
+\r
+import twitter4j.Status;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class Main {\r
+\r
+       public static void main(String[] args) {\r
+               test1();\r
+       }\r
+       \r
+       public static void test1(){\r
+               String text = "aa bb cc";\r
+               int length = 3;\r
+               String ret = StringUtility.parseSubstring(text, length);\r
+               System.out.println(ret);\r
+       }\r
+\r
+       public static void main() {\r
+               String consumerKey = "";\r
+               String consumerSecret = "";\r
+               String tokenKey = "";\r
+               String tokenSecret = "";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+\r
+                       AccessToken accessToken = new AccessToken(tokenKey, tokenSecret);\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Status status = twitter.updateStatus("\83e\83X\83g");\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+               }\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/4c/a05c3cd8eb6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/4c/a05c3cd8eb6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 4486a91..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.yuji.tdb.db;\r
-\r
-import javax.jdo.PersistenceManager;\r
-\r
-public class KeyValueDao {\r
-       private static KeyValueDao instance = null;\r
-       \r
-       public static KeyValueDao getInstance(){\r
-               if (instance == null){\r
-                       instance = new KeyValueDao();\r
-               }\r
-               return instance;\r
-       }\r
-       \r
-       private PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
-       \r
-       private KeyValueDao(){\r
-               \r
-       }\r
-       \r
-       public String get(String key){\r
-               KeyValue keyValue = pm.getObjectById(KeyValue.class, key);\r
-               if (keyValue == null){\r
-                       return null;\r
-               }\r
-               return keyValue.getValue();\r
-       }\r
-       \r
-       public void put(String key, String value){\r
-               KeyValue keyValue = new KeyValue(key, value);\r
-               pm.makePersistent(keyValue);\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/5/903de7bf646b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/5/903de7bf646b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..66bb7a0
--- /dev/null
@@ -0,0 +1,14 @@
+package com.yuji.tdb.db;
+
+@PersistenceCapable(identityType = IdentityType.APPLICATION)
+public class Train {
+    @PrimaryKey
+    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
+    private Long id;
+    @Persistent
+    private String name;
+    @Persistent
+    private String searchWord;
+    @Persistent
+    private int count;
+}
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/52/f064530c166b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/52/f064530c166b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..f8278d4
--- /dev/null
@@ -0,0 +1,144 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Calendar cal = Calendar.getInstance();\r
+                       Date date = cal.getTime();\r
+                       long cur = date.getTime();\r
+                       \r
+                       Query query = new Query();\r
+                       //query.setRpp(1000); // TODO\r
+                       query.setQuery(text);\r
+                       QueryResult result = twitter.search(query);\r
+                       List<Tweet> tweets = result.getTweets();\r
+                       \r
+                       int count = 0;\r
+                       int hit = 0;\r
+                       int mhit = 0;\r
+                       \r
+                       int index;\r
+                       int mindex = 0;\r
+                       int size = tweets.size();\r
+                       for (index = 0; index < size; index++) {\r
+                               Tweet tweet = tweets.get(index);\r
+                               \r
+                               Date at = tweet.getCreatedAt();\r
+                               long t = at.getTime();\r
+                               \r
+                               String message = tweet.getText();\r
+                               \r
+                               if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
+                                       continue;\r
+                               }\r
+                               hit = filter(message);\r
+                               if (hit <= 0) {\r
+                                       // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                                       continue;\r
+                               }\r
+                               if (hit > mhit){\r
+                                       hit = mhit;\r
+                                       mindex = index;\r
+                               }\r
+\r
+                               System.out.println("@" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               count++;\r
+                       }\r
+               \r
+                       String message = "";\r
+                       if (count < 5){\r
+                               message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+                       }\r
+                       else {\r
+                               int N = 100;\r
+                               \r
+                               String sample = tweets.get(mindex).getText();\r
+                               sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
+                               message = sample + " " + df.format(date) + " count=" + count;                                                   \r
+                       }\r
+                       System.out.println(message);//TODO\r
+                       Status status = twitter.updateStatus(message);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/54/10334ae0e96500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/54/10334ae0e96500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/54/f0875033106b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/54/f0875033106b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..05cada5
--- /dev/null
@@ -0,0 +1,46 @@
+package com.yuji.tdb.main;\r
+\r
+import twitter4j.Status;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class Main {\r
+\r
+       public static void main(String[] args) {\r
+               test1();\r
+       }\r
+       \r
+       public static void test1(){\r
+               String text = "\82 \82¢ bb cc";\r
+               int length = 4;\r
+               String ret = StringUtility.parseSubstring(text, length);\r
+               System.out.println(ret);\r
+       }\r
+\r
+       public static void main() {\r
+               String consumerKey = "";\r
+               String consumerSecret = "";\r
+               String tokenKey = "";\r
+               String tokenSecret = "";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+\r
+                       AccessToken accessToken = new AccessToken(tokenKey, tokenSecret);\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Status status = twitter.updateStatus("\83e\83X\83g");\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+               }\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/56/a0a02626106b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/56/a0a02626106b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..0c486e8
--- /dev/null
@@ -0,0 +1,46 @@
+package com.yuji.tdb.main;\r
+\r
+import twitter4j.Status;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class Main {\r
+\r
+       public static void main(String[] args) {\r
+               test1();\r
+       }\r
+       \r
+       public static void test1(){\r
+               String text = "aa bb cc";\r
+               int length = 5;\r
+               String ret = StringUtility.parseSubstring(text, length);\r
+               System.out.println(ret);\r
+       }\r
+\r
+       public static void main() {\r
+               String consumerKey = "";\r
+               String consumerSecret = "";\r
+               String tokenKey = "";\r
+               String tokenSecret = "";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+\r
+                       AccessToken accessToken = new AccessToken(tokenKey, tokenSecret);\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Status status = twitter.updateStatus("\83e\83X\83g");\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+               }\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/5b/606e02a1126b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/5b/606e02a1126b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..3bdb5f8
--- /dev/null
@@ -0,0 +1,141 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Calendar cal = Calendar.getInstance();\r
+                       Date date = cal.getTime();\r
+                       long cur = date.getTime();\r
+                       \r
+                       Query query = new Query();\r
+                       //query.setRpp(1000); // TODO\r
+                       query.setQuery(text);\r
+                       QueryResult result = twitter.search(query);\r
+                       List<Tweet> tweets = result.getTweets();\r
+                       \r
+                       int count = 0;\r
+                       int hit = 0;\r
+                       int mhit = 0;\r
+                       \r
+                       int index;\r
+                       int mindex = 0;\r
+                       int size = tweets.size();\r
+                       for (index = 0; index < size; index++) {\r
+                               Tweet tweet = tweets.get(index);\r
+                               \r
+                               Date at = tweet.getCreatedAt();\r
+                               long t = at.getTime();\r
+                               \r
+                               String message = tweet.getText();\r
+                               \r
+                               if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
+                                       continue;\r
+                               }\r
+                               hit = filter(message);\r
+                               if (hit <= 0) {\r
+                                       // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                                       continue;\r
+                               }\r
+                               if (hit > mhit){\r
+                                       hit = mhit;\r
+                                       mindex = index;\r
+                               }\r
+\r
+                               System.out.println("@" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               count++;\r
+                       }\r
+               \r
+                       String message = "";\r
+                       if (count < 10){\r
+                               message = "\92x\89\84\82È\82µ " + date.toString();                        \r
+                       }\r
+                       else {\r
+                               int N = 100;\r
+                               \r
+                               String sample = tweets.get(mindex).getText();\r
+                               sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
+                               message = sample + " " + date.toString() + " count=" + count;                                                   \r
+                       }\r
+                       System.out.println(message);//TODO\r
+                       Status status = twitter.updateStatus(message);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/5b/d0097442676b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/5b/d0097442676b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..1e5163e
--- /dev/null
@@ -0,0 +1,161 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.db.Train;\r
+import com.yuji.tdb.db.TrainDao;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+               //TimeZone.setDefault(TimeZone.getTimeZone("JST")); // TODO \8fê\8f\8a\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       twite(text, twitter);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+\r
+       private void twite(String text, Twitter twitter) throws TwitterException {\r
+               Calendar cal = Calendar.getInstance();\r
+               Date date = cal.getTime();\r
+               long cur = date.getTime();\r
+               \r
+               Query query = new Query();\r
+               //query.setRpp(1000); // TODO\r
+               query.setQuery(text);\r
+               QueryResult result = twitter.search(query);\r
+               List<Tweet> tweets = result.getTweets();\r
+               \r
+               int count = 0;\r
+               int hit = 0;\r
+               int mhit = 0;\r
+               \r
+               int index;\r
+               int mindex = 0;\r
+               int size = tweets.size();\r
+               for (index = 0; index < size; index++) {\r
+                       Tweet tweet = tweets.get(index);\r
+                       \r
+                       Date at = tweet.getCreatedAt();\r
+                       long t = at.getTime();\r
+                       \r
+                       String message = tweet.getText();\r
+                       \r
+                       if (t < cur - 30 * 60 * 1000){\r
+                               System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               continue;\r
+                       }\r
+                       hit = filter(message);\r
+                       if (hit <= 0) {\r
+                               // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                               continue;\r
+                       }\r
+                       if (hit > mhit){\r
+                               hit = mhit;\r
+                               mindex = index;\r
+                       }\r
+\r
+                       System.out.println("@" + tweet.getFromUser() + " - "\r
+                                       + tweet.getText() + at);\r
+                       count++;\r
+               }\r
+\r
+               String message = "";\r
+               if (count < 5){\r
+                       message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+               }\r
+               else {\r
+                       int N = 100;\r
+                       \r
+                       String sample = tweets.get(mindex).getText();\r
+                       sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                       sample = StringUtility.parseSubstring(sample, N);\r
+                       message = sample + " " + df.format(date) + " count=" + count;                                                   \r
+               }\r
+               System.out.println(message); //TODO\r
+               Status status = twitter.updateStatus(message); //TODO\r
+       }\r
+       \r
+       private List<Train> getTrainList(){\r
+               TrainDao dao = TrainDao.getInstance();\r
+               List<Train> list = dao.search();\r
+               if (list.size() <= 0){\r
+                       Train train;\r
+                       \r
+                       train = new Train();\r
+               }\r
+               return list;\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/5d/807f3406136b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/5d/807f3406136b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..66afd13
--- /dev/null
@@ -0,0 +1,141 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Calendar cal = Calendar.getInstance();\r
+                       Date date = cal.getTime();\r
+                       long cur = date.getTime();\r
+                       \r
+                       Query query = new Query();\r
+                       //query.setRpp(1000); // TODO\r
+                       query.setQuery(text);\r
+                       QueryResult result = twitter.search(query);\r
+                       List<Tweet> tweets = result.getTweets();\r
+                       \r
+                       int count = 0;\r
+                       int hit = 0;\r
+                       int mhit = 0;\r
+                       \r
+                       int index;\r
+                       int mindex = 0;\r
+                       int size = tweets.size();\r
+                       for (index = 0; index < size; index++) {\r
+                               Tweet tweet = tweets.get(index);\r
+                               \r
+                               Date at = tweet.getCreatedAt();\r
+                               long t = at.getTime();\r
+                               \r
+                               String message = tweet.getText();\r
+                               \r
+                               if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
+                                       continue;\r
+                               }\r
+                               hit = filter(message);\r
+                               if (hit <= 0) {\r
+                                       // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                                       continue;\r
+                               }\r
+                               if (hit > mhit){\r
+                                       hit = mhit;\r
+                                       mindex = index;\r
+                               }\r
+\r
+                               System.out.println("@" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               count++;\r
+                       }\r
+               \r
+                       String message = "";\r
+                       if (count < 5){\r
+                               message = "\92x\89\84\82È\82µ " + DateFormat.format(date);        \r
+                       }\r
+                       else {\r
+                               int N = 100;\r
+                               \r
+                               String sample = tweets.get(mindex).getText();\r
+                               sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
+                               message = sample + " " + date.toString() + " count=" + count;                                                   \r
+                       }\r
+                       System.out.println(message);//TODO\r
+                       Status status = twitter.updateStatus(message);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/64/202eb3df166b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/64/202eb3df166b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..6dabcd2
--- /dev/null
@@ -0,0 +1,145 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.TimeZone;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+               //TimeZone.setDefault(TimeZone.getTimeZone("JST")); // TODO \8fê\8f\8a\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Calendar cal = Calendar.getInstance();\r
+                       Date date = cal.getTime();\r
+                       long cur = date.getTime();\r
+                       \r
+                       Query query = new Query();\r
+                       //query.setRpp(1000); // TODO\r
+                       query.setQuery(text);\r
+                       QueryResult result = twitter.search(query);\r
+                       List<Tweet> tweets = result.getTweets();\r
+                       \r
+                       int count = 0;\r
+                       int hit = 0;\r
+                       int mhit = 0;\r
+                       \r
+                       int index;\r
+                       int mindex = 0;\r
+                       int size = tweets.size();\r
+                       for (index = 0; index < size; index++) {\r
+                               Tweet tweet = tweets.get(index);\r
+                               \r
+                               Date at = tweet.getCreatedAt();\r
+                               long t = at.getTime();\r
+                               \r
+                               String message = tweet.getText();\r
+                               \r
+                               if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
+                                       continue;\r
+                               }\r
+                               hit = filter(message);\r
+                               if (hit <= 0) {\r
+                                       // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                                       continue;\r
+                               }\r
+                               if (hit > mhit){\r
+                                       hit = mhit;\r
+                                       mindex = index;\r
+                               }\r
+\r
+                               System.out.println("@" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               count++;\r
+                       }\r
+               \r
+                       String message = "";\r
+                       if (count < 5){\r
+                               message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+                       }\r
+                       else {\r
+                               int N = 100;\r
+                               \r
+                               String sample = tweets.get(mindex).getText();\r
+                               sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
+                               message = sample + " " + df.format(date) + " count=" + count;                                                   \r
+                       }\r
+                       System.out.println(message);//TODO\r
+                       Status status = twitter.updateStatus(message);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/64/4052d11a106b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/64/4052d11a106b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..9be18d3
--- /dev/null
@@ -0,0 +1,46 @@
+package com.yuji.tdb.main;\r
+\r
+import twitter4j.Status;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class Main {\r
+\r
+       public static void main(String[] args) {\r
+               test1();\r
+       }\r
+       \r
+       public static void test1(){\r
+               String text = "aa bb cc";\r
+               int length = 4;\r
+               String ret = StringUtility.parseSubstring(text, length);\r
+               System.out.println(ret);\r
+       }\r
+\r
+       public static void main() {\r
+               String consumerKey = "";\r
+               String consumerSecret = "";\r
+               String tokenKey = "";\r
+               String tokenSecret = "";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+\r
+                       AccessToken accessToken = new AccessToken(tokenKey, tokenSecret);\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Status status = twitter.updateStatus("\83e\83X\83g");\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+               }\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/64/60a80efbea6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/64/60a80efbea6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 523bd6c..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.yuji.tdb.db;\r
-\r
-public class KeyValue {\r
-       private String key;\r
-       private String value;\r
-       \r
-       public String getKey() {\r
-               return key;\r
-       }\r
-       public void setKey(String key) {\r
-               this.key = key;\r
-       }\r
-       public String getValue() {\r
-               return value;\r
-       }\r
-       public void setValue(String value) {\r
-               this.value = value;\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/68/802098ddeb6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/68/802098ddeb6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 9ebc91a..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-import java.util.logging.Logger;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static final Logger log = Logger\r
-                       .getLogger(TrainDelayBotServlet.class.getName());\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               try {\r
-                       log.info("start");\r
-                       \r
-                       KeyValueDao dao = KeyValueDao.getInstance();\r
-                       \r
-                       resp.setContentType("text/plain");\r
-                       resp.getWriter().println("<h3>traindelaybot Hello, world</h3>");\r
-\r
-                       String parmConsumerKey = req.getParameter("key");\r
-                       String parmConsumerSecret = req.getParameter("secret");\r
-                       String parmResult = req.getParameter("result");\r
-                       if (!CommonUtil.isNull(parmConsumerKey)\r
-                                       && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                               setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                               parmConsumerSecret);\r
-                               \r
-                               \r
-                               return;\r
-                       }\r
-\r
-                       if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                                       || CommonUtil.isNull(consumerSecret)) {\r
-                               log.warning("001");\r
-                               return;\r
-                       }\r
-\r
-                       if (!CommonUtil.isNull(parmResult)) {\r
-                               resultOAuthAuthorization();\r
-                               return;\r
-                       }\r
-\r
-                       if (accessToken == null) {\r
-                               log.warning("002");\r
-                               return;\r
-                       }\r
-\r
-                       TwitterUtil util = TwitterUtil.getInstance();\r
-                       util.main(consumerKey, consumerSecret, accessToken);\r
-               } finally {\r
-                       log.info("end");\r
-               }\r
-\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               }\r
-       }\r
-}\r
@@ -2,18 +2,18 @@ package com.yuji.tdb.db;
 \r
 import javax.jdo.PersistenceManager;\r
 \r
-public class KeyValueDao {\r
-       private static KeyValueDao instance = null;\r
+public class TrainDao {\r
+       private static TrainDao instance = null;\r
        private PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
                \r
-       public static KeyValueDao getInstance(){\r
+       public static TrainDao getInstance(){\r
                if (instance == null){\r
-                       instance = new KeyValueDao();\r
+                       instance = new TrainDao();\r
                }\r
                return instance;\r
        }\r
        \r
-       private KeyValueDao(){\r
+       private TrainDao(){\r
                \r
        }\r
        \r
@@ -29,4 +29,8 @@ public class KeyValueDao {
                KeyValue keyValue = new KeyValue(key, value);\r
                pm.makePersistent(keyValue);\r
        }\r
+\r
+       public void put(String key, int value){\r
+               put(key, String.valueOf(value));\r
+       }\r
 }\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/70/502fb6d38a6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/70/502fb6d38a6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 759c969..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               resp.setContentType("text/plain");\r
-               resp.getWriter().println(" traindelaybot Hello, world");\r
-\r
-               String consumerKey = req.getParameter("key");\r
-               String consumerSecret = req.getParameter("secret");\r
-               String result = req.getParameter("result");\r
-               if (!CommonUtil.isNull(consumerKey)\r
-                               && !CommonUtil.isNull(consumerSecret)) {\r
-                       setOAuthAuthorization(req, resp, consumerKey, consumerSecret);\r
-                       return;\r
-               }\r
-\r
-               if (requestToken == null\r
-                               || CommonUtil.isNull(TrainDelayBotServlet.consumerKey)\r
-                               || CommonUtil.isNull(TrainDelayBotServlet.consumerSecret)) {\r
-                       return;\r
-               }\r
-\r
-               if (!CommonUtil.isNull(result)) {\r
-                       resultOAuthAuthorization();\r
-                       return;\r
-               }\r
-\r
-               // TODO null check\r
-               TwitterUtil util = TwitterUtil.getInstance();\r
-               util.main(TrainDelayBotServlet.consumerKey,\r
-                               TrainDelayBotServlet.consumerSecret, accessToken);\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String consumerKey, String consumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(consumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(consumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       TrainDelayBotServlet.consumerKey = consumerKey;\r
-                       TrainDelayBotServlet.consumerSecret = consumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/73/204c5c5a666b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/73/204c5c5a666b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..2a25b1a
--- /dev/null
@@ -0,0 +1,39 @@
+package com.yuji.tdb.db;\r
+\r
+import java.util.List;\r
+\r
+import javax.jdo.PersistenceManager;\r
+\r
+public class TrainDao {\r
+       private static TrainDao instance = null;\r
+       private PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
+\r
+       public static TrainDao getInstance() {\r
+               if (instance == null) {\r
+                       instance = new TrainDao();\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TrainDao() {\r
+\r
+       }\r
+\r
+       public String get(String key) {\r
+               String query = "SELECT FROM " + Train.class.getName();\r
+               List<Train> list = (List<Train>) pm.newQuery(query).execute();\r
+\r
+               for (Train train : list) {\r
+               }\r
+               pm.close();\r
+       }\r
+\r
+       public void put(String key, String value) {\r
+               KeyValue keyValue = new KeyValue(key, value);\r
+               pm.makePersistent(keyValue);\r
+       }\r
+\r
+       public void put(String key, int value) {\r
+               put(key, String.valueOf(value));\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/75/80253805106b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/75/80253805106b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..1d27c92
--- /dev/null
@@ -0,0 +1,48 @@
+package com.yuji.tdb.utility;
+
+import java.util.regex.Pattern;
+
+public class StringUtility {
+       private static Pattern ptnAlnum = Pattern.compile("[a-zA-Z0-9]");
+       private static Pattern ptnSpace = Pattern.compile("\\s");
+       private static Pattern ptnAscii = Pattern.compile("\\p{ASCII}");
+       
+       public static String parseSubstring(String text, int length){
+               int len = text.length();
+               int status = -1;
+               int pos = 0;
+               
+               for (int i = 0; i < len + 1 && i < length + 1; i++){
+                       if (i >= len){
+                               pos = i;
+                               break;
+                       }
+                       String ch = text.substring(i, i + 1);
+                       
+                       if (ptnAlnum.matcher(ch).matches()){
+                               if (status != 0){
+                                       pos = i;
+                                       status = 0;
+                               }
+                       }
+                       else if (ptnSpace.matcher(ch).matches()){
+                               pos = i;
+                               status = 1;
+                       }
+                       else if (ptnAscii.matcher(ch).matches()){
+                               if (status != 2){
+                                       pos = i;
+                                       status = 2;
+                               }                               
+                       }
+                       else {
+                               pos = i;
+                               status = 3;
+                       }
+               }
+               if (pos == 0){
+                       return text.substring(0, (len < length)? len : length);                 
+               }
+               return text.substring(0, pos);
+       }
+}
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/76/80ee2380906500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/76/80ee2380906500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 779eb26..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<cronentries>\r
-       <cron>\r
-               <url>/traindelaybot</url>\r
-               <description>traindelaybot the run every 5 minutes</description>\r
-               <schedule>every 5 minutes</schedule>\r
-               <timezone>Asia/Tokyo</timezone>\r
-       </cron>\r
-</cronentries>\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/78/404799cdeb6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/78/404799cdeb6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 08c4db1..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.yuji.tdb.db;\r
-\r
-import javax.jdo.PersistenceManager;\r
-\r
-public class KeyValueDao {\r
-       private PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
-       \r
-       public String get(String key){\r
-               KeyValue keyValue = pm.getObjectById(KeyValue.class, key);\r
-               if (keyValue == null){\r
-                       return null;\r
-               }\r
-               return keyValue.getValue();\r
-       }\r
-       \r
-       public void put(String key, String value){\r
-               KeyValue keyValue = new KeyValue(key, value);\r
-               pm.makePersistent(keyValue);\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/78/f08185a38f6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/78/f08185a38f6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 43e62c9..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-import java.util.logging.Logger;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       private static final Logger log = Logger\r
-                       .getLogger(TrainDelayBotServlet.class.getName());\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               try {\r
-                       log.warning("start");\r
-\r
-                       log.info("info");\r
-                       log.warning("warning");\r
-                       log.fine("fine");\r
-                       log.severe("severe");\r
-                       \r
-                       resp.setContentType("text/plain");\r
-                       resp.getWriter().println("<h3>traindelaybot Hello, world</h3>");\r
-\r
-                       String parmConsumerKey = req.getParameter("key");\r
-                       String parmConsumerSecret = req.getParameter("secret");\r
-                       String parmResult = req.getParameter("result");\r
-                       if (!CommonUtil.isNull(parmConsumerKey)\r
-                                       && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                               setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                               parmConsumerSecret);\r
-                               return;\r
-                       }\r
-\r
-                       if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                                       || CommonUtil.isNull(consumerSecret)) {\r
-                               resp.getWriter().println("<div>001</div>");\r
-                               return;\r
-                       }\r
-\r
-                       if (!CommonUtil.isNull(parmResult)) {\r
-                               resultOAuthAuthorization();\r
-                               return;\r
-                       }\r
-\r
-                       if (accessToken == null) {\r
-                               resp.getWriter().println("<div>002</div>");\r
-                               return;\r
-                       }\r
-\r
-                       TwitterUtil util = TwitterUtil.getInstance();\r
-                       util.main(consumerKey, consumerSecret, accessToken);\r
-               } finally {\r
-                       log.warning("end");\r
-               }\r
-\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/7b/f0152533906500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/7b/f0152533906500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 0ee837a..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-import java.util.logging.Logger;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       private static final Logger log = Logger\r
-                       .getLogger(TrainDelayBotServlet.class.getName());\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               try {\r
-                       log.info("start");\r
-                       \r
-                       resp.setContentType("text/plain");\r
-                       resp.getWriter().println("<h3>traindelaybot Hello, world</h3>");\r
-\r
-                       String parmConsumerKey = req.getParameter("key");\r
-                       String parmConsumerSecret = req.getParameter("secret");\r
-                       String parmResult = req.getParameter("result");\r
-                       if (!CommonUtil.isNull(parmConsumerKey)\r
-                                       && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                               setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                               parmConsumerSecret);\r
-                               return;\r
-                       }\r
-\r
-                       if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                                       || CommonUtil.isNull(consumerSecret)) {\r
-                               log.warning("001");\r
-                               return;\r
-                       }\r
-\r
-                       if (!CommonUtil.isNull(parmResult)) {\r
-                               resultOAuthAuthorization();\r
-                               return;\r
-                       }\r
-\r
-                       if (accessToken == null) {\r
-                               log.warning("002");\r
-                               return;\r
-                       }\r
-\r
-                       TwitterUtil util = TwitterUtil.getInstance();\r
-                       util.main(consumerKey, consumerSecret, accessToken);\r
-               } finally {\r
-                       log.info("end");\r
-               }\r
-\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/7c/005c8003136b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/7c/005c8003136b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..8e7aa99
--- /dev/null
@@ -0,0 +1,141 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Calendar cal = Calendar.getInstance();\r
+                       Date date = cal.getTime();\r
+                       long cur = date.getTime();\r
+                       \r
+                       Query query = new Query();\r
+                       //query.setRpp(1000); // TODO\r
+                       query.setQuery(text);\r
+                       QueryResult result = twitter.search(query);\r
+                       List<Tweet> tweets = result.getTweets();\r
+                       \r
+                       int count = 0;\r
+                       int hit = 0;\r
+                       int mhit = 0;\r
+                       \r
+                       int index;\r
+                       int mindex = 0;\r
+                       int size = tweets.size();\r
+                       for (index = 0; index < size; index++) {\r
+                               Tweet tweet = tweets.get(index);\r
+                               \r
+                               Date at = tweet.getCreatedAt();\r
+                               long t = at.getTime();\r
+                               \r
+                               String message = tweet.getText();\r
+                               \r
+                               if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
+                                       continue;\r
+                               }\r
+                               hit = filter(message);\r
+                               if (hit <= 0) {\r
+                                       // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                                       continue;\r
+                               }\r
+                               if (hit > mhit){\r
+                                       hit = mhit;\r
+                                       mindex = index;\r
+                               }\r
+\r
+                               System.out.println("@" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               count++;\r
+                       }\r
+               \r
+                       String message = "";\r
+                       if (count < 5){\r
+                               message = "\92x\89\84\82È\82µ " + date.toString();                        \r
+                       }\r
+                       else {\r
+                               int N = 100;\r
+                               \r
+                               String sample = tweets.get(mindex).getText();\r
+                               sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
+                               message = sample + " " + date.toString() + " count=" + count;                                                   \r
+                       }\r
+                       System.out.println(message);//TODO\r
+                       Status status = twitter.updateStatus(message);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/7e/309e4416106b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/7e/309e4416106b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..ff3804d
--- /dev/null
@@ -0,0 +1,46 @@
+package com.yuji.tdb.main;\r
+\r
+import twitter4j.Status;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class Main {\r
+\r
+       public static void main(String[] args) {\r
+               test1();\r
+       }\r
+       \r
+       public static void test1(){\r
+               String text = "aa bb cc";\r
+               int length = 3;\r
+               String ret = StringUtility.parseSubstring(text, length);\r
+               System.out.println(ret);\r
+       }\r
+\r
+       public static void main() {\r
+               String consumerKey = "";\r
+               String consumerSecret = "";\r
+               String tokenKey = "";\r
+               String tokenSecret = "";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+\r
+                       AccessToken accessToken = new AccessToken(tokenKey, tokenSecret);\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Status status = twitter.updateStatus("\83e\83X\83g");\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+               }\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/8/40d0961c8f6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/8/40d0961c8f6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 8910417..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-import java.util.logging.Logger;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       private static final Logger log = Logger.getLogger(TrainDelayBotServlet.class.getName());\r
-       \r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               resp.setContentType("text/plain");\r
-               resp.getWriter().println("<h3>traindelaybot Hello, world</h3>");\r
-\r
-               String parmConsumerKey = req.getParameter("key");\r
-               String parmConsumerSecret = req.getParameter("secret");\r
-               String parmResult = req.getParameter("result");\r
-               if (!CommonUtil.isNull(parmConsumerKey)\r
-                               && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                       setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                       parmConsumerSecret);\r
-                       return;\r
-               }\r
-\r
-               if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                               || CommonUtil.isNull(consumerSecret)) {\r
-                       resp.getWriter().println("<div>001</div>");\r
-                       return;\r
-               }\r
-\r
-               if (!CommonUtil.isNull(parmResult)) {\r
-                       resultOAuthAuthorization();\r
-                       return;\r
-               }\r
-\r
-               if (accessToken == null){\r
-                       resp.getWriter().println("<div>002</div>");\r
-                       return;\r
-               }\r
-               \r
-               TwitterUtil util = TwitterUtil.getInstance();\r
-               util.main(consumerKey, consumerSecret, accessToken);\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/82/60f5eed7ea6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/82/60f5eed7ea6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 35bee5f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.yuji.tdb.db;\r
-\r
-import javax.jdo.PersistenceManager;\r
-\r
-public class KeyValueDao {\r
-       private PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
-       \r
-       public String get(String key){\r
-               KeyValue keyValue = pm.getObjectById(keyValue.class, key);\r
-               return keyValue.getValue();\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/85/b0a8a6ff8a6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/85/b0a8a6ff8a6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index fd4cca8..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               resp.setContentType("text/plain");\r
-               resp.getWriter().println(" traindelaybot Hello, world");\r
-\r
-               String parmConsumerKey = req.getParameter("key");\r
-               String parmConsumerSecret = req.getParameter("secret");\r
-               String parmResult = req.getParameter("result");\r
-               if (!CommonUtil.isNull(parmConsumerKey)\r
-                               && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                       setOAuthAuthorization(req, resp, parmConsumerKey, parmConsumerSecret);\r
-                       return;\r
-               }\r
-\r
-               if (requestToken == null\r
-                               || CommonUtil.isNull(TrainDelayBotServlet.consumerKey)\r
-                               || CommonUtil.isNull(TrainDelayBotServlet.consumerSecret)) {\r
-                       return;\r
-               }\r
-\r
-               if (!CommonUtil.isNull(parmResult)) {\r
-                       resultOAuthAuthorization();\r
-                       return;\r
-               }\r
-\r
-               // TODO null check\r
-               TwitterUtil util = TwitterUtil.getInstance();\r
-               util.main(TrainDelayBotServlet.consumerKey,\r
-                               TrainDelayBotServlet.consumerSecret, accessToken);\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String consumerKey, String consumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(consumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(consumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       TrainDelayBotServlet.consumerKey = consumerKey;\r
-                       TrainDelayBotServlet.consumerSecret = consumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/87/50202ce0666b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/87/50202ce0666b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..4dfa2f3
--- /dev/null
@@ -0,0 +1,155 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.TimeZone;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.db.TrainDao;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+               //TimeZone.setDefault(TimeZone.getTimeZone("JST")); // TODO \8fê\8f\8a\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       twite(text, twitter);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+\r
+       private void twite(String text, Twitter twitter) throws TwitterException {\r
+               Calendar cal = Calendar.getInstance();\r
+               Date date = cal.getTime();\r
+               long cur = date.getTime();\r
+               \r
+               Query query = new Query();\r
+               //query.setRpp(1000); // TODO\r
+               query.setQuery(text);\r
+               QueryResult result = twitter.search(query);\r
+               List<Tweet> tweets = result.getTweets();\r
+               \r
+               int count = 0;\r
+               int hit = 0;\r
+               int mhit = 0;\r
+               \r
+               int index;\r
+               int mindex = 0;\r
+               int size = tweets.size();\r
+               for (index = 0; index < size; index++) {\r
+                       Tweet tweet = tweets.get(index);\r
+                       \r
+                       Date at = tweet.getCreatedAt();\r
+                       long t = at.getTime();\r
+                       \r
+                       String message = tweet.getText();\r
+                       \r
+                       if (t < cur - 30 * 60 * 1000){\r
+                               System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               continue;\r
+                       }\r
+                       hit = filter(message);\r
+                       if (hit <= 0) {\r
+                               // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                               continue;\r
+                       }\r
+                       if (hit > mhit){\r
+                               hit = mhit;\r
+                               mindex = index;\r
+                       }\r
+\r
+                       System.out.println("@" + tweet.getFromUser() + " - "\r
+                                       + tweet.getText() + at);\r
+                       count++;\r
+               }\r
+\r
+               String message = "";\r
+               if (count < 5){\r
+                       message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+               }\r
+               else {\r
+                       int N = 100;\r
+                       \r
+                       String sample = tweets.get(mindex).getText();\r
+                       sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                       sample = StringUtility.parseSubstring(sample, N);\r
+                       message = sample + " " + df.format(date) + " count=" + count;                                                   \r
+               }\r
+               System.out.println(message); //TODO\r
+               Status status = twitter.updateStatus(message); //TODO\r
+       }\r
+       \r
+       private List<Train> getTrainList(){\r
+               TrainDao dao = TrainDao.getInstance();\r
+               list = dao.search();\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/89/700228b4676b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/89/700228b4676b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..08c96ed
--- /dev/null
@@ -0,0 +1,170 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.db.Train;\r
+import com.yuji.tdb.db.TrainDao;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+               //TimeZone.setDefault(TimeZone.getTimeZone("JST")); // TODO \8fê\8f\8a\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       List<Train> list = getTrainList();\r
+                       for (Train train : list){\r
+                               twite(twitter, train);\r
+                       }\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+\r
+       private void twite(Twitter twitter, Train train) throws TwitterException {\r
+               Calendar cal = Calendar.getInstance();\r
+               Date date = cal.getTime();\r
+               long cur = date.getTime();\r
+               \r
+               Query query = new Query();\r
+               //query.setRpp(1000); // TODO\r
+               query.setQuery(train.getSearchWord());\r
+               QueryResult result = twitter.search(query);\r
+               List<Tweet> tweets = result.getTweets();\r
+               \r
+               int count = 0;\r
+               int hit = 0;\r
+               int mhit = 0;\r
+               \r
+               int index;\r
+               int mindex = 0;\r
+               int size = tweets.size();\r
+               for (index = 0; index < size; index++) {\r
+                       Tweet tweet = tweets.get(index);\r
+                       \r
+                       Date at = tweet.getCreatedAt();\r
+                       long t = at.getTime();\r
+                       \r
+                       String message = tweet.getText();\r
+                       \r
+                       if (t < cur - 30 * 60 * 1000){\r
+                               System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               continue;\r
+                       }\r
+                       hit = filter(message);\r
+                       if (hit <= 0) {\r
+                               // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                               continue;\r
+                       }\r
+                       if (hit > mhit){\r
+                               hit = mhit;\r
+                               mindex = index;\r
+                       }\r
+\r
+                       System.out.println("@" + tweet.getFromUser() + " - "\r
+                                       + tweet.getText() + at);\r
+                       count++;\r
+               }\r
+\r
+               String message = "";\r
+               if (count < train.getCount()){\r
+                       message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+               }\r
+               else {\r
+                       int N = 100;\r
+                       \r
+                       String sample = tweets.get(mindex).getText();\r
+                       sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                       sample = StringUtility.parseSubstring(sample, N);\r
+                       message = sample + " " + df.format(date) + " count=" + count;                                                   \r
+               }\r
+               System.out.println(message); //TODO\r
+               Status status = twitter.updateStatus(message); //TODO\r
+       }\r
+       \r
+       private List<Train> getTrainList(){\r
+               TrainDao dao = TrainDao.getInstance();\r
+               List<Train> list = dao.search();\r
+               if (list.size() <= 0){\r
+                       Train train;\r
+                       \r
+                       train = new Train("\8b\9e\95l\93\8c\96k\90ü", "\8b\9e\95l\93\8c\96k", 5);\r
+                       list.add(train);\r
+                       train = new Train("\93\8c\8aC\93¹\90ü", "\93\8c\8aC\93¹", 5);\r
+                       list.add(train);\r
+                       train = new Train("\8b\9e\95l\8b}\8ds\90ü", "\8b\9e\8b}", 5);\r
+                       list.add(train);\r
+                       \r
+                       for (Train t : list){\r
+                               dao.put(t);\r
+                       }\r
+               }\r
+               return list;\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/8a/f0c1cafa166b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/8a/f0c1cafa166b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..b44efd0
--- /dev/null
@@ -0,0 +1,149 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.TimeZone;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+               //TimeZone.setDefault(TimeZone.getTimeZone("JST")); // TODO \8fê\8f\8a\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       twite(text, twitter);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+\r
+       private void twite(String text, Twitter twitter) throws TwitterException {\r
+               Calendar cal = Calendar.getInstance();\r
+               Date date = cal.getTime();\r
+               long cur = date.getTime();\r
+               \r
+               Query query = new Query();\r
+               //query.setRpp(1000); // TODO\r
+               query.setQuery(text);\r
+               QueryResult result = twitter.search(query);\r
+               List<Tweet> tweets = result.getTweets();\r
+               \r
+               int count = 0;\r
+               int hit = 0;\r
+               int mhit = 0;\r
+               \r
+               int index;\r
+               int mindex = 0;\r
+               int size = tweets.size();\r
+               for (index = 0; index < size; index++) {\r
+                       Tweet tweet = tweets.get(index);\r
+                       \r
+                       Date at = tweet.getCreatedAt();\r
+                       long t = at.getTime();\r
+                       \r
+                       String message = tweet.getText();\r
+                       \r
+                       if (t < cur - 30 * 60 * 1000){\r
+                               System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               continue;\r
+                       }\r
+                       hit = filter(message);\r
+                       if (hit <= 0) {\r
+                               // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                               continue;\r
+                       }\r
+                       if (hit > mhit){\r
+                               hit = mhit;\r
+                               mindex = index;\r
+                       }\r
+\r
+                       System.out.println("@" + tweet.getFromUser() + " - "\r
+                                       + tweet.getText() + at);\r
+                       count++;\r
+               }\r
+\r
+               String message = "";\r
+               if (count < 5){\r
+                       message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+               }\r
+               else {\r
+                       int N = 100;\r
+                       \r
+                       String sample = tweets.get(mindex).getText();\r
+                       sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                       sample = StringUtility.parseSubstring(sample, N);\r
+                       message = sample + " " + df.format(date) + " count=" + count;                                                   \r
+               }\r
+               System.out.println(message);//TODO\r
+               Status status = twitter.updateStatus(message);\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/8b/50ef23a9eb6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/8b/50ef23a9eb6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 043d8cd..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-import java.util.logging.Logger;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static final Logger log = Logger\r
-                       .getLogger(TrainDelayBotServlet.class.getName());\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               try {\r
-                       log.info("start");\r
-                       \r
-                       resp.setContentType("text/plain");\r
-                       resp.getWriter().println("<h3>traindelaybot Hello, world</h3>");\r
-\r
-                       String parmConsumerKey = req.getParameter("key");\r
-                       String parmConsumerSecret = req.getParameter("secret");\r
-                       String parmResult = req.getParameter("result");\r
-                       if (!CommonUtil.isNull(parmConsumerKey)\r
-                                       && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                               setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                               parmConsumerSecret);\r
-                               return;\r
-                       }\r
-\r
-                       if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                                       || CommonUtil.isNull(consumerSecret)) {\r
-                               log.warning("001");\r
-                               return;\r
-                       }\r
-\r
-                       if (!CommonUtil.isNull(parmResult)) {\r
-                               resultOAuthAuthorization();\r
-                               return;\r
-                       }\r
-\r
-                       if (accessToken == null) {\r
-                               log.warning("002");\r
-                               return;\r
-                       }\r
-\r
-                       TwitterUtil util = TwitterUtil.getInstance();\r
-                       util.main(consumerKey, consumerSecret, accessToken);\r
-               } finally {\r
-                       log.info("end");\r
-               }\r
-\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/90/c0b28524ea6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/90/c0b28524ea6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/93/c032e2e8666b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/93/c032e2e8666b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..01e9974
--- /dev/null
@@ -0,0 +1,159 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.db.Train;\r
+import com.yuji.tdb.db.TrainDao;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+               //TimeZone.setDefault(TimeZone.getTimeZone("JST")); // TODO \8fê\8f\8a\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       twite(text, twitter);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+\r
+       private void twite(String text, Twitter twitter) throws TwitterException {\r
+               Calendar cal = Calendar.getInstance();\r
+               Date date = cal.getTime();\r
+               long cur = date.getTime();\r
+               \r
+               Query query = new Query();\r
+               //query.setRpp(1000); // TODO\r
+               query.setQuery(text);\r
+               QueryResult result = twitter.search(query);\r
+               List<Tweet> tweets = result.getTweets();\r
+               \r
+               int count = 0;\r
+               int hit = 0;\r
+               int mhit = 0;\r
+               \r
+               int index;\r
+               int mindex = 0;\r
+               int size = tweets.size();\r
+               for (index = 0; index < size; index++) {\r
+                       Tweet tweet = tweets.get(index);\r
+                       \r
+                       Date at = tweet.getCreatedAt();\r
+                       long t = at.getTime();\r
+                       \r
+                       String message = tweet.getText();\r
+                       \r
+                       if (t < cur - 30 * 60 * 1000){\r
+                               System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               continue;\r
+                       }\r
+                       hit = filter(message);\r
+                       if (hit <= 0) {\r
+                               // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                               continue;\r
+                       }\r
+                       if (hit > mhit){\r
+                               hit = mhit;\r
+                               mindex = index;\r
+                       }\r
+\r
+                       System.out.println("@" + tweet.getFromUser() + " - "\r
+                                       + tweet.getText() + at);\r
+                       count++;\r
+               }\r
+\r
+               String message = "";\r
+               if (count < 5){\r
+                       message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+               }\r
+               else {\r
+                       int N = 100;\r
+                       \r
+                       String sample = tweets.get(mindex).getText();\r
+                       sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                       sample = StringUtility.parseSubstring(sample, N);\r
+                       message = sample + " " + df.format(date) + " count=" + count;                                                   \r
+               }\r
+               System.out.println(message); //TODO\r
+               Status status = twitter.updateStatus(message); //TODO\r
+       }\r
+       \r
+       private List<Train> getTrainList(){\r
+               TrainDao dao = TrainDao.getInstance();\r
+               List<Train> list = dao.search();\r
+               if (list.size() <= 0){\r
+                       \r
+               }\r
+               return list;\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/95/803f40638b6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/95/803f40638b6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 4e55a2b..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               resp.setContentType("text/plain");\r
-               resp.getWriter().println(" traindelaybot Hello, world");\r
-\r
-               String parmConsumerKey = req.getParameter("key");\r
-               String parmConsumerSecret = req.getParameter("secret");\r
-               String parmResult = req.getParameter("result");\r
-               if (!CommonUtil.isNull(parmConsumerKey)\r
-                               && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                       setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                       parmConsumerSecret);\r
-                       return;\r
-               }\r
-\r
-               if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                               || CommonUtil.isNull(consumerSecret)) {\r
-                       return;\r
-               }\r
-\r
-               if (!CommonUtil.isNull(parmResult)) {\r
-                       resultOAuthAuthorization();\r
-                       return;\r
-               }\r
-\r
-               TwitterUtil util = TwitterUtil.getInstance();\r
-               util.main(consumerKey, consumerSecret, accessToken);\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
@@ -16,14 +16,14 @@ import twitter4j.TwitterFactory;
 import twitter4j.auth.AccessToken;\r
 import twitter4j.conf.ConfigurationBuilder;\r
 \r
-import com.yuji.tdb.TrainDelayBotServlet;\r
 import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
 \r
 public class TwitterUtil {\r
-       private static TwitterUtil instance = null;\r
-       private static Object obj = new Object();\r
        private static final Logger log = Logger\r
                        .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
 \r
        public static TwitterUtil getInstance() {\r
                if (instance == null) {\r
@@ -56,7 +56,7 @@ public class TwitterUtil {
                        long cur = date.getTime();\r
                        \r
                        Query query = new Query();\r
-                       query.setRpp(100); // TODO\r
+                       //query.setRpp(1000); // TODO\r
                        query.setQuery(text);\r
                        QueryResult result = twitter.search(query);\r
                        List<Tweet> tweets = result.getTweets();\r
@@ -73,9 +73,12 @@ public class TwitterUtil {
                                \r
                                Date at = tweet.getCreatedAt();\r
                                long t = at.getTime();\r
+                               \r
                                String message = tweet.getText();\r
                                \r
                                if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
                                        continue;\r
                                }\r
                                hit = filter(message);\r
@@ -98,15 +101,14 @@ public class TwitterUtil {
                                message = "\92x\89\84\82È\82µ " + date.toString();                        \r
                        }\r
                        else {\r
-                               int N = 50;\r
+                               int N = 100;\r
                                \r
                                String sample = tweets.get(mindex).getText();\r
-                               if (sample.length() > N){\r
-                                       sample = sample.substring(0, N);\r
-                               }\r
                                sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
                                message = sample + " " + date.toString() + " count=" + count;                                                   \r
                        }\r
+                       System.out.println(message);\r
                        Status status = twitter.updateStatus(message);\r
                } catch (TwitterException e) {\r
                        // TODO Auto-generated catch block\r
@@ -123,7 +125,9 @@ public class TwitterUtil {
                        keywords.add("\92x\89\84");\r
                        keywords.add("\92x\82ê");\r
                        keywords.add("\90U\82è\91Ö\82¦");\r
-                       keywords.add("\8bÙ\8b}\92â\8e~");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
                }\r
 \r
                int count = 0;\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/99/f0ca4e2e106b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/99/f0ca4e2e106b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..fe94479
--- /dev/null
@@ -0,0 +1,46 @@
+package com.yuji.tdb.main;\r
+\r
+import twitter4j.Status;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class Main {\r
+\r
+       public static void main(String[] args) {\r
+               test1();\r
+       }\r
+       \r
+       public static void test1(){\r
+               String text = "\82 \82¢ bb cc";\r
+               int length = 5;\r
+               String ret = StringUtility.parseSubstring(text, length);\r
+               System.out.println(ret);\r
+       }\r
+\r
+       public static void main() {\r
+               String consumerKey = "";\r
+               String consumerSecret = "";\r
+               String tokenKey = "";\r
+               String tokenSecret = "";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+\r
+                       AccessToken accessToken = new AccessToken(tokenKey, tokenSecret);\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Status status = twitter.updateStatus("\83e\83X\83g");\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+               }\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9b/2092e4728a6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9b/2092e4728a6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 048cd88..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               resp.setContentType("text/plain");\r
-               resp.getWriter().println(" traindelaybot Hello, world");\r
-\r
-               String consumerKey = req.getParameter("key");\r
-               String consumerSecret = req.getParameter("secret");\r
-               String result = req.getParameter("result");\r
-               if (!CommonUtil.isNull(consumerKey)\r
-                               && !CommonUtil.isNull(consumerSecret)) {\r
-                       setOAuthAuthorization(req, resp, consumerKey, consumerSecret);\r
-                       return;\r
-               } \r
-               \r
-               if (requestToken == null || CommonUtil.isNull(TrainDelayBotServlet.consumerKey)\r
-                               || CommonUtil.isNull(TrainDelayBotServlet.consumerSecret)) {\r
-                       return;\r
-               }               \r
-               \r
-               if (!CommonUtil.isNull(result)) {\r
-                       resultOAuthAuthorization();\r
-                       return;\r
-               }\r
-\r
-               // TODO null check\r
-               TwitterUtil util = TwitterUtil.getInstance();\r
-               util.main(TrainDelayBotServlet.consumerKey,\r
-                               TrainDelayBotServlet.consumerSecret, accessToken);\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String consumerKey, String consumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(consumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(consumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       TrainDelayBotServlet.consumerKey = consumerKey;\r
-                       TrainDelayBotServlet.consumerSecret = consumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9c/c09796a2666b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9c/c09796a2666b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..270a432
--- /dev/null
@@ -0,0 +1,40 @@
+package com.yuji.tdb.db;
+
+import javax.jdo.annotations.IdGeneratorStrategy;
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.PersistenceCapable;
+import javax.jdo.annotations.Persistent;
+import javax.jdo.annotations.PrimaryKey;
+
+@PersistenceCapable(identityType = IdentityType.APPLICATION)
+public class Train {
+    @PrimaryKey
+    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
+    private Long id;
+    @Persistent
+    private String name;
+       @Persistent
+    private String searchWord;
+    @Persistent
+    private int count;
+
+    public Train(Long id, String name, String searchWord, int count){
+       this.id = id;
+       this.name = name;
+       this.searchWord = searchWord;
+       this.count = count;
+    }
+    
+    public Long getId() {
+               return id;
+       }
+       public String getName() {
+               return name;
+       }
+       public String getSearchWord() {
+               return searchWord;
+       }
+       public int getCount() {
+               return count;
+       }
+}
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a/9003368eeb6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a/9003368eeb6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 4470e6e..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.yuji.tdb.db;\r
-\r
-import javax.jdo.PersistenceManager;\r
-\r
-public class KeyValueDao {\r
-       private PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
-       \r
-       public String get(String key){\r
-               KeyValue keyValue = pm.getObjectById(KeyValue.class, key);\r
-               return keyValue.getValue();\r
-       }\r
-       \r
-       public void put(String key, String value){\r
-               KeyValue keyValue = new KeyValue(key, value);\r
-               pm.makePersistent(keyValue);\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a2/209be17eeb6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a2/209be17eeb6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 36fd2cf..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.yuji.tdb.db;\r
-\r
-import javax.jdo.PersistenceManager;\r
-\r
-public class KeyValueDao {\r
-       private PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
-       \r
-       public String get(String key){\r
-               KeyValue keyValue = pm.getObjectById(KeyValue.class, key);\r
-               return keyValue.getValue();\r
-       }\r
-       \r
-       public void put(String key, String value){\r
-               KeyValue keyValue = new KeyValue(key, value);\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a4/40c69c5a136b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a4/40c69c5a136b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..0304199
--- /dev/null
@@ -0,0 +1,142 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Calendar cal = Calendar.getInstance();\r
+                       Date date = cal.getTime();\r
+                       long cur = date.getTime();\r
+                       \r
+                       Query query = new Query();\r
+                       //query.setRpp(1000); // TODO\r
+                       query.setQuery(text);\r
+                       QueryResult result = twitter.search(query);\r
+                       List<Tweet> tweets = result.getTweets();\r
+                       \r
+                       int count = 0;\r
+                       int hit = 0;\r
+                       int mhit = 0;\r
+                       \r
+                       int index;\r
+                       int mindex = 0;\r
+                       int size = tweets.size();\r
+                       for (index = 0; index < size; index++) {\r
+                               Tweet tweet = tweets.get(index);\r
+                               \r
+                               Date at = tweet.getCreatedAt();\r
+                               long t = at.getTime();\r
+                               \r
+                               String message = tweet.getText();\r
+                               \r
+                               if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
+                                       continue;\r
+                               }\r
+                               hit = filter(message);\r
+                               if (hit <= 0) {\r
+                                       // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                                       continue;\r
+                               }\r
+                               if (hit > mhit){\r
+                                       hit = mhit;\r
+                                       mindex = index;\r
+                               }\r
+\r
+                               System.out.println("@" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               count++;\r
+                       }\r
+               \r
+                       String message = "";\r
+                       if (count < 5){\r
+                               message = "\92x\89\84\82È\82µ " + DateFormat.format(date);        \r
+                       }\r
+                       else {\r
+                               int N = 100;\r
+                               \r
+                               String sample = tweets.get(mindex).getText();\r
+                               sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
+                               message = sample + " " + date.toString() + " count=" + count;                                                   \r
+                       }\r
+                       System.out.println(message);//TODO\r
+                       Status status = twitter.updateStatus(message);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a4/f03f48f8eb6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a4/f03f48f8eb6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 0bd3159..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-import java.util.logging.Logger;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.db.KeyValueDao;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static final Logger log = Logger\r
-                       .getLogger(TrainDelayBotServlet.class.getName());\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       private KeyValueDao dao = KeyValueDao.getInstance();\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               try {\r
-                       log.info("start");\r
-                       \r
-                       resp.setContentType("text/plain");\r
-                       resp.getWriter().println("<h3>traindelaybot Hello, world</h3>");\r
-\r
-                       String parmConsumerKey = req.getParameter("key");\r
-                       String parmConsumerSecret = req.getParameter("secret");\r
-                       String parmResult = req.getParameter("result");\r
-                       if (!CommonUtil.isNull(parmConsumerKey)\r
-                                       && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                               setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                               parmConsumerSecret);\r
-                               \r
-                               \r
-                               return;\r
-                       }\r
-\r
-                       if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                                       || CommonUtil.isNull(consumerSecret)) {\r
-                               log.warning("001");\r
-                               return;\r
-                       }\r
-\r
-                       if (!CommonUtil.isNull(parmResult)) {\r
-                               resultOAuthAuthorization();\r
-                               return;\r
-                       }\r
-\r
-                       if (accessToken == null) {\r
-                               log.warning("002");\r
-                               return;\r
-                       }\r
-\r
-                       TwitterUtil util = TwitterUtil.getInstance();\r
-                       util.main(consumerKey, consumerSecret, accessToken);\r
-               } finally {\r
-                       log.info("end");\r
-               }\r
-\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a5/40f42873136b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/a5/40f42873136b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..f610df1
--- /dev/null
@@ -0,0 +1,143 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new DateFormat("yyyy/MM/dd");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Calendar cal = Calendar.getInstance();\r
+                       Date date = cal.getTime();\r
+                       long cur = date.getTime();\r
+                       \r
+                       Query query = new Query();\r
+                       //query.setRpp(1000); // TODO\r
+                       query.setQuery(text);\r
+                       QueryResult result = twitter.search(query);\r
+                       List<Tweet> tweets = result.getTweets();\r
+                       \r
+                       int count = 0;\r
+                       int hit = 0;\r
+                       int mhit = 0;\r
+                       \r
+                       int index;\r
+                       int mindex = 0;\r
+                       int size = tweets.size();\r
+                       for (index = 0; index < size; index++) {\r
+                               Tweet tweet = tweets.get(index);\r
+                               \r
+                               Date at = tweet.getCreatedAt();\r
+                               long t = at.getTime();\r
+                               \r
+                               String message = tweet.getText();\r
+                               \r
+                               if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
+                                       continue;\r
+                               }\r
+                               hit = filter(message);\r
+                               if (hit <= 0) {\r
+                                       // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                                       continue;\r
+                               }\r
+                               if (hit > mhit){\r
+                                       hit = mhit;\r
+                                       mindex = index;\r
+                               }\r
+\r
+                               System.out.println("@" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               count++;\r
+                       }\r
+               \r
+                       String message = "";\r
+                       if (count < 5){\r
+                               message = "\92x\89\84\82È\82µ " + DateFormat.format(date);        \r
+                       }\r
+                       else {\r
+                               int N = 100;\r
+                               \r
+                               String sample = tweets.get(mindex).getText();\r
+                               sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
+                               message = sample + " " + date.toString() + " count=" + count;                                                   \r
+                       }\r
+                       System.out.println(message);//TODO\r
+                       Status status = twitter.updateStatus(message);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/aa/60880ca7e86500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/aa/60880ca7e86500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index ac352b8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.yuji.tdb.db;\r
-\r
-public class PMFactory {\r
-\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bb/60e0098b0e6b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bb/60e0098b0e6b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..b64b11f
--- /dev/null
@@ -0,0 +1,46 @@
+package com.yuji.tdb.main;\r
+\r
+import twitter4j.Status;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class Main {\r
+\r
+       public static void main(String[] args) {\r
+               test1();\r
+       }\r
+       \r
+       public static void test1(){\r
+               String text = "\82 \82¢\82¤\82¦\82¨";\r
+               int length = 3;\r
+               String ret = StringUtility.parseSubstring(text, length);\r
+               System.out.println(ret);\r
+       }\r
+\r
+       public static void main() {\r
+               String consumerKey = "";\r
+               String consumerSecret = "";\r
+               String tokenKey = "";\r
+               String tokenSecret = "";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+\r
+                       AccessToken accessToken = new AccessToken(tokenKey, tokenSecret);\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Status status = twitter.updateStatus("\83e\83X\83g");\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+               }\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b0b49a548b6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b0b49a548b6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index aadde10..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               resp.setContentType("text/plain");\r
-               resp.getWriter().println(" traindelaybot Hello, world");\r
-\r
-               String parmConsumerKey = req.getParameter("key");\r
-               String parmConsumerSecret = req.getParameter("secret");\r
-               String parmResult = req.getParameter("result");\r
-               if (!CommonUtil.isNull(parmConsumerKey)\r
-                               && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                       setOAuthAuthorization(req, resp, parmConsumerKey, parmConsumerSecret);\r
-                       return;\r
-               }\r
-\r
-               if (requestToken == null\r
-                               || CommonUtil.isNull(consumerKey)\r
-                               || CommonUtil.isNull(consumerSecret)) {\r
-                       return;\r
-               }\r
-\r
-               if (!CommonUtil.isNull(parmResult)) {\r
-                       resultOAuthAuthorization();\r
-                       return;\r
-               }\r
-\r
-               // TODO null check\r
-               TwitterUtil util = TwitterUtil.getInstance();\r
-               util.main(consumerKey,\r
-                               consumerSecret, accessToken);\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey, String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b0de668c166b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b0de668c166b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..b198de9
--- /dev/null
@@ -0,0 +1,145 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.TimeZone;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+               TimeZone.setDefault(TimeZone.getTimeZone("JST")); // TODO \8fê\8f\8a\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Calendar cal = Calendar.getInstance();\r
+                       Date date = cal.getTime();\r
+                       long cur = date.getTime();\r
+                       \r
+                       Query query = new Query();\r
+                       //query.setRpp(1000); // TODO\r
+                       query.setQuery(text);\r
+                       QueryResult result = twitter.search(query);\r
+                       List<Tweet> tweets = result.getTweets();\r
+                       \r
+                       int count = 0;\r
+                       int hit = 0;\r
+                       int mhit = 0;\r
+                       \r
+                       int index;\r
+                       int mindex = 0;\r
+                       int size = tweets.size();\r
+                       for (index = 0; index < size; index++) {\r
+                               Tweet tweet = tweets.get(index);\r
+                               \r
+                               Date at = tweet.getCreatedAt();\r
+                               long t = at.getTime();\r
+                               \r
+                               String message = tweet.getText();\r
+                               \r
+                               if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
+                                       continue;\r
+                               }\r
+                               hit = filter(message);\r
+                               if (hit <= 0) {\r
+                                       // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                                       continue;\r
+                               }\r
+                               if (hit > mhit){\r
+                                       hit = mhit;\r
+                                       mindex = index;\r
+                               }\r
+\r
+                               System.out.println("@" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               count++;\r
+                       }\r
+               \r
+                       String message = "";\r
+                       if (count < 5){\r
+                               message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+                       }\r
+                       else {\r
+                               int N = 100;\r
+                               \r
+                               String sample = tweets.get(mindex).getText();\r
+                               sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
+                               message = sample + " " + df.format(date) + " count=" + count;                                                   \r
+                       }\r
+                       System.out.println(message);//TODO\r
+                       Status status = twitter.updateStatus(message);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bd/80845745d46a001115b0ad2bca3cccad b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bd/80845745d46a001115b0ad2bca3cccad
new file mode 100644 (file)
index 0000000..e24b621
--- /dev/null
@@ -0,0 +1,48 @@
+package com.yuji.tdb.utility;
+
+import java.util.regex.Pattern;
+
+public class StringUtility {
+       private static Pattern ptnAlnum = Pattern.compile("[a-zA-Z0-9]");
+       private static Pattern ptnSpace = Pattern.compile("TODO");
+       private static Pattern ptnAscii = Pattern.compile("\\p{ASCII}");
+       
+       public static String parseSubstring(String text, int length){
+               int len = text.length();
+               int status = -1;
+               int pos = 0;
+               
+               for (int i = 0; i < len + 1 && i < length + 1; i++){
+                       if (i >= len){
+                               pos = i;
+                               break;
+                       }
+                       String ch = text.substring(i, i + 1);
+                       
+                       if (ptnAlnum.matcher(ch).matches()){
+                               if (status != 0){
+                                       pos = i;
+                                       status = 0;
+                               }
+                       }
+                       else if (ptnSpace.matcher(ch).matches()){
+                               pos = i;
+                               status = 1;
+                       }
+                       else if (ptnAscii.matcher(ch).matches()){
+                               if (status != 2){
+                                       pos = i;
+                                       status = 2;
+                               }                               
+                       }
+                       else {
+                               pos = i;
+                               status = 3;
+                       }
+               }
+               if (pos == 0){
+                       return text.substring(0, (len < length)? len : length);                 
+               }
+               return text.substring(0, pos);
+       }
+}
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bd/a0ca78a0f16500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/bd/a0ca78a0f16500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 1388d5f..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<cronentries>\r
-       <cron>\r
-               <url>/traindelaybot</url>\r
-               <description>traindelaybot the run every 30 minutes</description>\r
-               <schedule>every 30 minutes</schedule>\r
-               <timezone>Asia/Tokyo</timezone>\r
-       </cron>\r
-</cronentries>\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c/30ed9725686b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c/30ed9725686b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..2b1c123
--- /dev/null
@@ -0,0 +1,172 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.db.Train;\r
+import com.yuji.tdb.db.TrainDao;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+               //TimeZone.setDefault(TimeZone.getTimeZone("JST")); // TODO \8fê\8f\8a\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       List<Train> list = getTrainList();\r
+                       for (Train train : list){\r
+                               twite(twitter, train);\r
+                       }\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+\r
+       private void twite(Twitter twitter, Train train) throws TwitterException {\r
+               Calendar cal = Calendar.getInstance();\r
+               Date date = cal.getTime();\r
+               long cur = date.getTime();\r
+               \r
+               Query query = new Query();\r
+               //query.setRpp(1000); // TODO\r
+               query.setQuery(train.getSearchWord());\r
+               QueryResult result = twitter.search(query);\r
+               List<Tweet> tweets = result.getTweets();\r
+               \r
+               int count = 0;\r
+               int hit = 0;\r
+               int mhit = 0;\r
+               \r
+               int index;\r
+               int mindex = 0;\r
+               int size = tweets.size();\r
+               for (index = 0; index < size; index++) {\r
+                       Tweet tweet = tweets.get(index);\r
+                       \r
+                       Date at = tweet.getCreatedAt();\r
+                       long t = at.getTime();\r
+                       \r
+                       String message = tweet.getText();\r
+                       \r
+                       if (t < cur - 30 * 60 * 1000){\r
+                               System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               continue;\r
+                       }\r
+                       hit = filter(message);\r
+                       if (hit <= 0) {\r
+                               System.out.println("\81¢" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                               continue;\r
+                       }\r
+                       if (hit > mhit){\r
+                               hit = mhit;\r
+                               mindex = index;\r
+                       }\r
+\r
+                       System.out.println("@" + tweet.getFromUser() + " - "\r
+                                       + tweet.getText() + at);\r
+                       count++;\r
+               }\r
+\r
+               String message = "";\r
+               if (count < train.getCount()){\r
+                       message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+               }\r
+               else {\r
+                       int N = 100;\r
+                       \r
+                       String sample = tweets.get(mindex).getText();\r
+                       sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                       sample = StringUtility.parseSubstring(sample, N);\r
+                       message = sample + " " + df.format(date) + " count=" + count;                                                   \r
+               }\r
+               System.out.println(message); //TODO\r
+               Status status = twitter.updateStatus(message); //TODO\r
+       }\r
+       \r
+       private List<Train> getTrainList(){\r
+               TrainDao dao = TrainDao.getInstance();\r
+               List<Train> list = dao.search();\r
+               if (list.size() <= 0){\r
+                       Train train;\r
+                       \r
+                       train = new Train("\8b\9e\95l\93\8c\96k\90ü", "\8b\9e\95l\93\8c\96k", 5);\r
+                       list.add(train);\r
+                       train = new Train("\93\8c\8aC\93¹\90ü", "\93\8c\8aC\93¹", 5);\r
+                       list.add(train);\r
+                       train = new Train("\8b\9e\95l\8b}\8ds\90ü", "\8b\9e\8b}", 5);\r
+                       list.add(train);\r
+                       \r
+                       for (Train t : list){\r
+                               dao.put(t);\r
+                       }\r
+               }\r
+               return list;\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c1/70cc2ee48a6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c1/70cc2ee48a6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 2958f91..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               resp.setContentType("text/plain");\r
-               resp.getWriter().println(" traindelaybot Hello, world");\r
-\r
-               String parmConsumerKey = req.getParameter("key");\r
-               String parmConsumerSecret = req.getParameter("secret");\r
-               String result = req.getParameter("result");\r
-               if (!CommonUtil.isNull(parmConsumerKey)\r
-                               && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                       setOAuthAuthorization(req, resp, parmConsumerKey, parmConsumerSecret);\r
-                       return;\r
-               }\r
-\r
-               if (requestToken == null\r
-                               || CommonUtil.isNull(TrainDelayBotServlet.consumerKey)\r
-                               || CommonUtil.isNull(TrainDelayBotServlet.consumerSecret)) {\r
-                       return;\r
-               }\r
-\r
-               if (!CommonUtil.isNull(result)) {\r
-                       resultOAuthAuthorization();\r
-                       return;\r
-               }\r
-\r
-               // TODO null check\r
-               TwitterUtil util = TwitterUtil.getInstance();\r
-               util.main(TrainDelayBotServlet.consumerKey,\r
-                               TrainDelayBotServlet.consumerSecret, accessToken);\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String consumerKey, String consumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(consumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(consumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       TrainDelayBotServlet.consumerKey = consumerKey;\r
-                       TrainDelayBotServlet.consumerSecret = consumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c5/7080417b0e6b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c5/7080417b0e6b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..1a00ce7
--- /dev/null
@@ -0,0 +1,48 @@
+package com.yuji.tdb.utility;
+
+import java.util.regex.Pattern;
+
+public class StringUtility {
+       private static Pattern ptnAlnum = Pattern.compile("[a-zA-Z0-9]");
+       private static Pattern ptnSpace = Pattern.compile(TODO);
+       private static Pattern ptnAscii = Pattern.compile("\\p{ASCII}");
+       
+       public static String parseSubstring(String text, int length){
+               int len = text.length();
+               int status = -1;
+               int pos = 0;
+               
+               for (int i = 0; i < len + 1 && i < length + 1; i++){
+                       if (i >= len){
+                               pos = i;
+                               break;
+                       }
+                       String ch = text.substring(i, i + 1);
+                       
+                       if (ptnAlnum.matcher(ch).matches()){
+                               if (status != 0){
+                                       pos = i;
+                                       status = 0;
+                               }
+                       }
+                       else if (ptnSpace.matcher(ch).matches()){
+                               pos = i;
+                               status = 1;
+                       }
+                       else if (ptnAscii.matcher(ch).matches()){
+                               if (status != 2){
+                                       pos = i;
+                                       status = 2;
+                               }                               
+                       }
+                       else {
+                               pos = i;
+                               status = 3;
+                       }
+               }
+               if (pos == 0){
+                       return text.substring(0, (len < length)? len : length);                 
+               }
+               return text.substring(0, pos);
+       }
+}
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c6/10cbb6e8686b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c6/10cbb6e8686b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..dd61743
--- /dev/null
@@ -0,0 +1,32 @@
+package com.yuji.tdb.db;\r
+\r
+import java.util.List;\r
+\r
+import javax.jdo.PersistenceManager;\r
+\r
+public class TrainDao {\r
+       private static TrainDao instance = null;\r
+       private PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
+\r
+       public static TrainDao getInstance() {\r
+               if (instance == null) {\r
+                       instance = new TrainDao();\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TrainDao() {\r
+\r
+       }\r
+\r
+       public List<Train> search() {\r
+               String query = "SELECT FROM " + Train.class.getName();\r
+               List<Train> list = (List<Train>) pm.newQuery(query).execute();\r
+               pm.close();\r
+               return list;\r
+       }\r
+\r
+       public void put(Train train) {\r
+               pm.makePersistent(train);\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c8/f0a63d728e6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/c8/f0a63d728e6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index affd3a9..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               resp.setContentType("text/plain");\r
-               resp.getWriter().println("<h3>traindelaybot Hello, world</h3>");\r
-\r
-               String parmConsumerKey = req.getParameter("key");\r
-               String parmConsumerSecret = req.getParameter("secret");\r
-               String parmResult = req.getParameter("result");\r
-               if (!CommonUtil.isNull(parmConsumerKey)\r
-                               && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                       setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                       parmConsumerSecret);\r
-                       return;\r
-               }\r
-\r
-               if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                               || CommonUtil.isNull(consumerSecret)) {\r
-                       resp.getWriter().println("<div>001</div>");\r
-                       return;\r
-               }\r
-\r
-               if (!CommonUtil.isNull(parmResult)) {\r
-                       resultOAuthAuthorization();\r
-                       return;\r
-               }\r
-\r
-               if (accessToken == null){\r
-                       resp.getWriter().println("<div>002</div>");\r
-                       return;\r
-               }\r
-               \r
-               TwitterUtil util = TwitterUtil.getInstance();\r
-               util.main(consumerKey, consumerSecret, accessToken);\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ce/50114f10ec6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ce/50114f10ec6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 5c296d3..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-import java.util.logging.Logger;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.db.KeyValueDao;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static final Logger log = Logger\r
-                       .getLogger(TrainDelayBotServlet.class.getName());\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       private KeyValueDao dao = KeyValueDao.getInstance();\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               try {\r
-                       log.info("start");\r
-                       \r
-                       resp.setContentType("text/plain");\r
-                       resp.getWriter().println("<h3>traindelaybot Hello, world</h3>");\r
-\r
-                       String parmConsumerKey = req.getParameter("key");\r
-                       String parmConsumerSecret = req.getParameter("secret");\r
-                       String parmResult = req.getParameter("result");\r
-                       if (!CommonUtil.isNull(parmConsumerKey)\r
-                                       && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                               setOAuthAuthorization(req, resp, parmConsumerKey,\r
-                                               parmConsumerSecret);\r
-                               \r
-                               dao.put("FOO", "aaa");\r
-                               \r
-                               return;\r
-                       }\r
-\r
-                       if (requestToken == null || CommonUtil.isNull(consumerKey)\r
-                                       || CommonUtil.isNull(consumerSecret)) {\r
-                               log.warning("001");\r
-                               return;\r
-                       }\r
-\r
-                       if (!CommonUtil.isNull(parmResult)) {\r
-                               resultOAuthAuthorization();\r
-                               return;\r
-                       }\r
-\r
-                       if (accessToken == null) {\r
-                               log.warning("002");\r
-                               return;\r
-                       }\r
-\r
-                       TwitterUtil util = TwitterUtil.getInstance();\r
-                       util.main(consumerKey, consumerSecret, accessToken);\r
-               } finally {\r
-                       log.info("end");\r
-               }\r
-\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String parmConsumerKey,\r
-                       String parmConsumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(parmConsumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(parmConsumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       consumerKey = parmConsumerKey;\r
-                       consumerSecret = parmConsumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d1/e01807fae96500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d1/e01807fae96500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index dc4bab6..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.yuji.tdb.db;\r
-\r
-public class KeyValue {\r
-       private String key;\r
-       private String value;\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d4/e0dc6685676b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/d4/e0dc6685676b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..81f19fd
--- /dev/null
@@ -0,0 +1,173 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.db.Train;\r
+import com.yuji.tdb.db.TrainDao;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+               //TimeZone.setDefault(TimeZone.getTimeZone("JST")); // TODO \8fê\8f\8a\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       List<Train> list = getTrainList();\r
+                       for (Train train : list){\r
+                               twite(twitter, train);\r
+                       }\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+\r
+       private void twite(Twitter twitter, Train train) throws TwitterException {\r
+               Calendar cal = Calendar.getInstance();\r
+               Date date = cal.getTime();\r
+               long cur = date.getTime();\r
+               \r
+               Query query = new Query();\r
+               //query.setRpp(1000); // TODO\r
+               query.setQuery(text);\r
+               QueryResult result = twitter.search(query);\r
+               List<Tweet> tweets = result.getTweets();\r
+               \r
+               int count = 0;\r
+               int hit = 0;\r
+               int mhit = 0;\r
+               \r
+               int index;\r
+               int mindex = 0;\r
+               int size = tweets.size();\r
+               for (index = 0; index < size; index++) {\r
+                       Tweet tweet = tweets.get(index);\r
+                       \r
+                       Date at = tweet.getCreatedAt();\r
+                       long t = at.getTime();\r
+                       \r
+                       String message = tweet.getText();\r
+                       \r
+                       if (t < cur - 30 * 60 * 1000){\r
+                               System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               continue;\r
+                       }\r
+                       hit = filter(message);\r
+                       if (hit <= 0) {\r
+                               // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                               continue;\r
+                       }\r
+                       if (hit > mhit){\r
+                               hit = mhit;\r
+                               mindex = index;\r
+                       }\r
+\r
+                       System.out.println("@" + tweet.getFromUser() + " - "\r
+                                       + tweet.getText() + at);\r
+                       count++;\r
+               }\r
+\r
+               String message = "";\r
+               if (count < 5){\r
+                       message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+               }\r
+               else {\r
+                       int N = 100;\r
+                       \r
+                       String sample = tweets.get(mindex).getText();\r
+                       sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                       sample = StringUtility.parseSubstring(sample, N);\r
+                       message = sample + " " + df.format(date) + " count=" + count;                                                   \r
+               }\r
+               System.out.println(message); //TODO\r
+               Status status = twitter.updateStatus(message); //TODO\r
+       }\r
+       \r
+       private List<Train> getTrainList(){\r
+               TrainDao dao = TrainDao.getInstance();\r
+               List<Train> list = dao.search();\r
+               if (list.size() <= 0){\r
+                       Train train;\r
+                       \r
+                       train = new Train("\8b\9e\95l\93\8c\96k\90ü", "\8b\9e\95l\93\8c\96k", 5);\r
+                       list.add(train);\r
+                       train = new Train("\93\8c\8aC\93¹\90ü", "\93\8c\8aC\93¹", 5);\r
+                       list.add(train);\r
+                       train = new Train("\8b\9e\95l\8b}\8ds\90ü", "\8b\9e\8b}", 5);\r
+                       list.add(train);\r
+                       \r
+                       for (Train t : list){\r
+                               dao.put(t);\r
+                       }\r
+               }\r
+               return list;\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/e8/10fcce04136b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/e8/10fcce04136b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..d183b17
--- /dev/null
@@ -0,0 +1,140 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Calendar cal = Calendar.getInstance();\r
+                       Date date = cal.getTime();\r
+                       long cur = date.getTime();\r
+                       \r
+                       Query query = new Query();\r
+                       //query.setRpp(1000); // TODO\r
+                       query.setQuery(text);\r
+                       QueryResult result = twitter.search(query);\r
+                       List<Tweet> tweets = result.getTweets();\r
+                       \r
+                       int count = 0;\r
+                       int hit = 0;\r
+                       int mhit = 0;\r
+                       \r
+                       int index;\r
+                       int mindex = 0;\r
+                       int size = tweets.size();\r
+                       for (index = 0; index < size; index++) {\r
+                               Tweet tweet = tweets.get(index);\r
+                               \r
+                               Date at = tweet.getCreatedAt();\r
+                               long t = at.getTime();\r
+                               \r
+                               String message = tweet.getText();\r
+                               \r
+                               if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
+                                       continue;\r
+                               }\r
+                               hit = filter(message);\r
+                               if (hit <= 0) {\r
+                                       // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                                       continue;\r
+                               }\r
+                               if (hit > mhit){\r
+                                       hit = mhit;\r
+                                       mindex = index;\r
+                               }\r
+\r
+                               System.out.println("@" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               count++;\r
+                       }\r
+               \r
+                       String message = "";\r
+                       if (count < 5){\r
+                       }\r
+                       else {\r
+                               int N = 100;\r
+                               \r
+                               String sample = tweets.get(mindex).getText();\r
+                               sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
+                               message = sample + " " + date.toString() + " count=" + count;                                                   \r
+                       }\r
+                       System.out.println(message);//TODO\r
+                       Status status = twitter.updateStatus(message);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/e8/b0c70338ea6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/e8/b0c70338ea6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 11cdc1e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.yuji.tdb.db;\r
-\r
-public class KeyValueDao {\r
-\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/eb/b04bd6a30e6b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/eb/b04bd6a30e6b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..0c486e8
--- /dev/null
@@ -0,0 +1,46 @@
+package com.yuji.tdb.main;\r
+\r
+import twitter4j.Status;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class Main {\r
+\r
+       public static void main(String[] args) {\r
+               test1();\r
+       }\r
+       \r
+       public static void test1(){\r
+               String text = "aa bb cc";\r
+               int length = 5;\r
+               String ret = StringUtility.parseSubstring(text, length);\r
+               System.out.println(ret);\r
+       }\r
+\r
+       public static void main() {\r
+               String consumerKey = "";\r
+               String consumerSecret = "";\r
+               String tokenKey = "";\r
+               String tokenSecret = "";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+\r
+                       AccessToken accessToken = new AccessToken(tokenKey, tokenSecret);\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Status status = twitter.updateStatus("\83e\83X\83g");\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+               }\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ef/702f96cdea6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ef/702f96cdea6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index aa7a0b3..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.yuji.tdb.db;\r
-\r
-public class KeyValueDao {\r
-       PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
-       \r
-       public String get(String key){\r
-               \r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/f1/90eb7b06eb6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/f1/90eb7b06eb6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 9f22d26..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.yuji.tdb.db;\r
-\r
-import javax.jdo.PersistenceManager;\r
-\r
-public class KeyValueDao {\r
-       private PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
-       \r
-       public String get(String key){\r
-               KeyValue keyValue = pm.getObjectById(KeyValue.class, key);\r
-               return keyValue.getValue();\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/f7/109715b4136b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/f7/109715b4136b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..8fd54cb
--- /dev/null
@@ -0,0 +1,144 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Calendar cal = Calendar.getInstance();\r
+                       Date date = cal.getTime();\r
+                       long cur = date.getTime();\r
+                       \r
+                       Query query = new Query();\r
+                       //query.setRpp(1000); // TODO\r
+                       query.setQuery(text);\r
+                       QueryResult result = twitter.search(query);\r
+                       List<Tweet> tweets = result.getTweets();\r
+                       \r
+                       int count = 0;\r
+                       int hit = 0;\r
+                       int mhit = 0;\r
+                       \r
+                       int index;\r
+                       int mindex = 0;\r
+                       int size = tweets.size();\r
+                       for (index = 0; index < size; index++) {\r
+                               Tweet tweet = tweets.get(index);\r
+                               \r
+                               Date at = tweet.getCreatedAt();\r
+                               long t = at.getTime();\r
+                               \r
+                               String message = tweet.getText();\r
+                               \r
+                               if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
+                                       continue;\r
+                               }\r
+                               hit = filter(message);\r
+                               if (hit <= 0) {\r
+                                       // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                                       continue;\r
+                               }\r
+                               if (hit > mhit){\r
+                                       hit = mhit;\r
+                                       mindex = index;\r
+                               }\r
+\r
+                               System.out.println("@" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               count++;\r
+                       }\r
+               \r
+                       String message = "";\r
+                       if (count < 5){\r
+                               message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+                       }\r
+                       else {\r
+                               int N = 100;\r
+                               \r
+                               String sample = tweets.get(mindex).getText();\r
+                               sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
+                               message = sample + " " + date.toString() + " count=" + count;                                                   \r
+                       }\r
+                       System.out.println(message);//TODO\r
+                       Status status = twitter.updateStatus(message);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/f7/80ac9a0f8b6500111e5bcf098ae37dc9 b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/f7/80ac9a0f8b6500111e5bcf098ae37dc9
deleted file mode 100644 (file)
index 1dba3c6..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-package com.yuji.tdb;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.servlet.http.HttpServlet;\r
-import javax.servlet.http.HttpServletRequest;\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-import twitter4j.Twitter;\r
-import twitter4j.TwitterException;\r
-import twitter4j.TwitterFactory;\r
-import twitter4j.auth.AccessToken;\r
-import twitter4j.auth.OAuthAuthorization;\r
-import twitter4j.auth.RequestToken;\r
-import twitter4j.conf.Configuration;\r
-import twitter4j.conf.ConfigurationBuilder;\r
-\r
-import com.yuji.tdb.common.CommonUtil;\r
-import com.yuji.tdb.twitter.TwitterUtil;\r
-\r
-@SuppressWarnings("serial")\r
-public class TrainDelayBotServlet extends HttpServlet {\r
-       private static RequestToken requestToken = null;\r
-       private static AccessToken accessToken = null;\r
-       private static String consumerKey = null;\r
-       private static String consumerSecret = null;\r
-\r
-       public void doGet(HttpServletRequest req, HttpServletResponse resp)\r
-                       throws IOException {\r
-               resp.setContentType("text/plain");\r
-               resp.getWriter().println(" traindelaybot Hello, world");\r
-\r
-               String parmConsumerKey = req.getParameter("key");\r
-               String parmConsumerSecret = req.getParameter("secret");\r
-               String parmResult = req.getParameter("result");\r
-               if (!CommonUtil.isNull(parmConsumerKey)\r
-                               && !CommonUtil.isNull(parmConsumerSecret)) {\r
-                       setOAuthAuthorization(req, resp, parmConsumerKey, parmConsumerSecret);\r
-                       return;\r
-               }\r
-\r
-               if (requestToken == null\r
-                               || CommonUtil.isNull(consumerKey)\r
-                               || CommonUtil.isNull(consumerSecret)) {\r
-                       return;\r
-               }\r
-\r
-               if (!CommonUtil.isNull(parmResult)) {\r
-                       resultOAuthAuthorization();\r
-                       return;\r
-               }\r
-\r
-               // TODO null check\r
-               TwitterUtil util = TwitterUtil.getInstance();\r
-               util.main(consumerKey,\r
-                               consumerSecret, accessToken);\r
-       }\r
-\r
-       private void setOAuthAuthorization(HttpServletRequest req,\r
-                       HttpServletResponse resp, String consumerKey, String consumerSecret) {\r
-               try {\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-\r
-                       confBuilder.setDebugEnabled(true);\r
-                       confBuilder.setOAuthConsumerKey(consumerKey);\r
-                       confBuilder.setOAuthConsumerSecret(consumerSecret);\r
-                       Configuration conf = confBuilder.build();\r
-\r
-                       String url = req.getRequestURL().toString();\r
-\r
-                       OAuthAuthorization oauth = new OAuthAuthorization(conf);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82©\82ç\82Ì\96ß\82è\90æ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       // AccessToken\83R\83\93\83g\83\8d\81[\83\89\82ð\8ew\92è\82µ\82Ü\82·\81B\r
-                       String callbackURL = url + "?result=yes";\r
-                       // RequestToken requestToken =\r
-                       // oauth.getOAuthRequestToken(callbackURL);\r
-                       requestToken = oauth.getOAuthRequestToken(callbackURL);\r
-                       // RequestToken\82ð\83Z\83b\83V\83\87\83\93\82É\95Û\91\82µ\82Ä\82¨\82«\82Ü\82·\81B\r
-                       // sessionScope("RequestToken", requestToken);\r
-                       // Twitter\82Ì\94F\8fØ\89æ\96Ê\82Ö\83\8a\83_\83C\83\8c\83N\83g\82µ\82Ü\82·\81B\r
-\r
-                       TrainDelayBotServlet.consumerKey = consumerKey;\r
-                       TrainDelayBotServlet.consumerSecret = consumerSecret;\r
-\r
-                       resp.sendRedirect(requestToken.getAuthenticationURL());\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               } catch (IOException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-\r
-       private void resultOAuthAuthorization() {\r
-               try {\r
-                       // Twitter twitter = new TwitterFactory().getInstance();\r
-                       // String tokenKey = requestToken.getToken();\r
-                       // String tokenSecret = requestToken.getTokenSecret();\r
-\r
-                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
-                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
-                                       .setOAuthConsumerSecret(consumerSecret);\r
-                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
-                       Twitter twitter = factory.getInstance();\r
-\r
-                       accessToken = twitter.getOAuthAccessToken(requestToken);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-               }\r
-       }\r
-}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/fe/90892eab136b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/fe/90892eab136b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..5b564cd
--- /dev/null
@@ -0,0 +1,144 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       Calendar cal = Calendar.getInstance();\r
+                       Date date = cal.getTime();\r
+                       long cur = date.getTime();\r
+                       \r
+                       Query query = new Query();\r
+                       //query.setRpp(1000); // TODO\r
+                       query.setQuery(text);\r
+                       QueryResult result = twitter.search(query);\r
+                       List<Tweet> tweets = result.getTweets();\r
+                       \r
+                       int count = 0;\r
+                       int hit = 0;\r
+                       int mhit = 0;\r
+                       \r
+                       int index;\r
+                       int mindex = 0;\r
+                       int size = tweets.size();\r
+                       for (index = 0; index < size; index++) {\r
+                               Tweet tweet = tweets.get(index);\r
+                               \r
+                               Date at = tweet.getCreatedAt();\r
+                               long t = at.getTime();\r
+                               \r
+                               String message = tweet.getText();\r
+                               \r
+                               if (t < cur - 30 * 60 * 1000){\r
+                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                                       + tweet.getText() + at);\r
+                                       continue;\r
+                               }\r
+                               hit = filter(message);\r
+                               if (hit <= 0) {\r
+                                       // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                                       continue;\r
+                               }\r
+                               if (hit > mhit){\r
+                                       hit = mhit;\r
+                                       mindex = index;\r
+                               }\r
+\r
+                               System.out.println("@" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               count++;\r
+                       }\r
+               \r
+                       String message = "";\r
+                       if (count < 5){\r
+                               message = "\92x\89\84\82È\82µ " + DateFormat.format(date);        \r
+                       }\r
+                       else {\r
+                               int N = 100;\r
+                               \r
+                               String sample = tweets.get(mindex).getText();\r
+                               sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                               sample = StringUtility.parseSubstring(sample, N);\r
+                               message = sample + " " + date.toString() + " count=" + count;                                                   \r
+                       }\r
+                       System.out.println(message);//TODO\r
+                       Status status = twitter.updateStatus(message);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ff/80d48880676b001115b7b82f2f4ce01a b/workspace/.metadata/.plugins/org.eclipse.core.resources/.history/ff/80d48880676b001115b7b82f2f4ce01a
new file mode 100644 (file)
index 0000000..a09f8bc
--- /dev/null
@@ -0,0 +1,170 @@
+package com.yuji.tdb.twitter;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.ArrayList;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.List;\r
+import java.util.logging.Logger;\r
+\r
+import twitter4j.Query;\r
+import twitter4j.QueryResult;\r
+import twitter4j.Status;\r
+import twitter4j.Tweet;\r
+import twitter4j.Twitter;\r
+import twitter4j.TwitterException;\r
+import twitter4j.TwitterFactory;\r
+import twitter4j.auth.AccessToken;\r
+import twitter4j.conf.ConfigurationBuilder;\r
+\r
+import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.db.Train;\r
+import com.yuji.tdb.db.TrainDao;\r
+import com.yuji.tdb.utility.StringUtility;\r
+\r
+public class TwitterUtil {\r
+       private static final Logger log = Logger\r
+                       .getLogger(TwitterUtil.class.getName());\r
+       private static TwitterUtil instance = null;\r
+       private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
+\r
+       public static TwitterUtil getInstance() {\r
+               if (instance == null) {\r
+                       synchronized (obj) {\r
+                               if (instance == null) {\r
+                                       instance = new TwitterUtil();\r
+                               }\r
+                       }\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TwitterUtil() {\r
+               //TimeZone.setDefault(TimeZone.getTimeZone("JST")); // TODO \8fê\8f\8a\r
+       }\r
+\r
+       public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
+\r
+               String text = "\8b\9e\95l\93\8c\96k";\r
+\r
+               try {\r
+                       ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
+                       confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
+                                       .setOAuthConsumerSecret(consumerSecret);\r
+                       TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
+                       Twitter twitter = factory.getInstance(accessToken);\r
+\r
+                       twite(text, twitter);\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+\r
+       private void twite(String text, Twitter twitter) throws TwitterException {\r
+               Calendar cal = Calendar.getInstance();\r
+               Date date = cal.getTime();\r
+               long cur = date.getTime();\r
+               \r
+               Query query = new Query();\r
+               //query.setRpp(1000); // TODO\r
+               query.setQuery(text);\r
+               QueryResult result = twitter.search(query);\r
+               List<Tweet> tweets = result.getTweets();\r
+               \r
+               int count = 0;\r
+               int hit = 0;\r
+               int mhit = 0;\r
+               \r
+               int index;\r
+               int mindex = 0;\r
+               int size = tweets.size();\r
+               for (index = 0; index < size; index++) {\r
+                       Tweet tweet = tweets.get(index);\r
+                       \r
+                       Date at = tweet.getCreatedAt();\r
+                       long t = at.getTime();\r
+                       \r
+                       String message = tweet.getText();\r
+                       \r
+                       if (t < cur - 30 * 60 * 1000){\r
+                               System.out.println("\81~" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               continue;\r
+                       }\r
+                       hit = filter(message);\r
+                       if (hit <= 0) {\r
+                               // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                               continue;\r
+                       }\r
+                       if (hit > mhit){\r
+                               hit = mhit;\r
+                               mindex = index;\r
+                       }\r
+\r
+                       System.out.println("@" + tweet.getFromUser() + " - "\r
+                                       + tweet.getText() + at);\r
+                       count++;\r
+               }\r
+\r
+               String message = "";\r
+               if (count < 5){\r
+                       message = "\92x\89\84\82È\82µ " + df.format(date);        \r
+               }\r
+               else {\r
+                       int N = 100;\r
+                       \r
+                       String sample = tweets.get(mindex).getText();\r
+                       sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                       sample = StringUtility.parseSubstring(sample, N);\r
+                       message = sample + " " + df.format(date) + " count=" + count;                                                   \r
+               }\r
+               System.out.println(message); //TODO\r
+               Status status = twitter.updateStatus(message); //TODO\r
+       }\r
+       \r
+       private List<Train> getTrainList(){\r
+               TrainDao dao = TrainDao.getInstance();\r
+               List<Train> list = dao.search();\r
+               if (list.size() <= 0){\r
+                       Train train;\r
+                       \r
+                       train = new Train("\8b\9e\95l\93\8c\96k\90ü", "\8b\9e\95l\93\8c\96k", 5);\r
+                       list.add(train);\r
+                       train = new Train("\93\8c\8aC\93¹\90ü", "\93\8c\8aC\93¹", 5);\r
+                       list.add(train);\r
+                       train = new Train("\8b\9e\95l\8b}\8ds\90ü", "\8b\9e\8b}", 5);\r
+                       list.add(train);\r
+                       \r
+                       for (Train t : list){\r
+                               dao.put(t);\r
+                       }\r
+               }\r
+               return list;\r
+       }\r
+       \r
+       private static List<String> keywords = null;\r
+\r
+       public int filter(String text) {\r
+               if (keywords == null) {\r
+                       keywords = new ArrayList<String>();\r
+                       keywords.add("\92x\89\84");\r
+                       keywords.add("\92x\82ê");\r
+                       keywords.add("\90U\82è\91Ö\82¦");\r
+                       keywords.add("\90U\91Ö");\r
+                       keywords.add("\92â\8e~");\r
+                       keywords.add("\8e\96\8cÌ");\r
+               }\r
+\r
+               int count = 0;\r
+               for (String keyword : keywords) {\r
+                       if (text.indexOf(keyword) >= 0) {\r
+                               count++;\r
+                       }\r
+               }\r
+               return count;\r
+       }\r
+}\r
index 7aa7daa..3671ac6 100644 (file)
Binary files a/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/7e/history.index and b/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/7e/history.index differ
index cc9220f..79efa42 100644 (file)
Binary files a/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/8d/history.index and b/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/8d/history.index differ
index d419b28..0e41211 100644 (file)
Binary files a/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/94/history.index and b/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/94/history.index differ
index a58d7e8..0d94216 100644 (file)
Binary files a/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/b9/history.index and b/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/b9/history.index differ
index 69bb0e8..b30d7b0 100644 (file)
Binary files a/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/history.index and b/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e4/81/5b/f2/history.index differ
diff --git a/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e8/a8/history.index b/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e8/a8/history.index
deleted file mode 100644 (file)
index f6e4f15..0000000
Binary files a/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/e8/a8/history.index and /dev/null differ
index eade802..8f33548 100644 (file)
Binary files a/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/properties.index and b/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.indexes/properties.index differ
index d8a92f1..5421481 100644 (file)
Binary files a/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.markers and b/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/.markers differ
index 82c0df0..72f4fc5 100644 (file)
Binary files a/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/org.eclipse.jdt.core/state.dat and b/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/TrainDelayBot/org.eclipse.jdt.core/state.dat differ
similarity index 73%
rename from workspace/.metadata/.plugins/org.eclipse.core.resources/.root/17.tree
rename to workspace/.metadata/.plugins/org.eclipse.core.resources/.root/19.tree
index 00e1d87..b0389fb 100644 (file)
Binary files a/workspace/.metadata/.plugins/org.eclipse.core.resources/.root/17.tree and b/workspace/.metadata/.plugins/org.eclipse.core.resources/.root/19.tree differ
index d891a66..9cb41d1 100644 (file)
Binary files a/workspace/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources and b/workspace/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ
index c08d155..7147a59 100644 (file)
@@ -10,8 +10,8 @@
 </launchGroup>
 <launchGroup id="org.eclipse.debug.ui.launchGroup.debug">
 <mruHistory>
-<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;Main&quot;/&gt;&#10;"/>
 <launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;TrainDelayBot&quot;/&gt;&#10;"/>
+<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;Main&quot;/&gt;&#10;"/>
 </mruHistory>
 <favorites>
 <launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;Test&quot;/&gt;&#10;"/>
@@ -20,8 +20,8 @@
 </launchGroup>
 <launchGroup id="org.eclipse.debug.ui.launchGroup.run">
 <mruHistory>
-<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;Main&quot;/&gt;&#10;"/>
 <launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;TrainDelayBot&quot;/&gt;&#10;"/>
+<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;Main&quot;/&gt;&#10;"/>
 </mruHistory>
 <favorites>
 <launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;launchConfiguration local=&quot;true&quot; path=&quot;Test&quot;/&gt;&#10;"/>
diff --git a/workspace/.metadata/.plugins/org.eclipse.epp.usagedata.recording/upload1.csv b/workspace/.metadata/.plugins/org.eclipse.epp.usagedata.recording/upload1.csv
new file mode 100644 (file)
index 0000000..f519db6
--- /dev/null
@@ -0,0 +1,251 @@
+what,kind,bundleId,bundleVersion,description,time
+stopped,bundle,org.eclipse.ui.cheatsheets,3.4.100.v20110425,"org.eclipse.ui.cheatsheets",1331397104663
+stopped,bundle,org.eclipse.help.ui,3.5.100.v20110425,"org.eclipse.help.ui",1331397104663
+stopped,bundle,org.eclipse.help.webapp,3.6.0.v20110518,"org.eclipse.help.webapp",1331397104663
+stopped,bundle,org.eclipse.epp.mpc.ui,1.1.0.I20110525-0742,"org.eclipse.epp.mpc.ui",1331397104665
+stopped,bundle,org.eclipse.epp.usagedata.ui,1.3.1.R201106061540,"org.eclipse.epp.usagedata.ui",1331397104665
+stopped,bundle,org.eclipse.ui.intro.universal,3.2.500.v20110510,"org.eclipse.ui.intro.universal",1331397104665
+stopped,bundle,org.eclipse.ui.intro,3.4.100.v20110425,"org.eclipse.ui.intro",1331397104665
+stopped,bundle,org.eclipse.help.base,3.6.0.v201106131736,"org.eclipse.help.base",1331397104665
+stopped,bundle,org.eclipse.equinox.http.jetty,2.0.100.v20110502,"org.eclipse.equinox.http.jetty",1331397104665
+stopped,bundle,com.google.appengine.eclipse.datatools,2.5.2.v201202290255-rel-r37,"com.google.appengine.eclipse.datatools",1331397104666
+stopped,bundle,com.google.appengine.eclipse.sdkbundle,1.6.3.v201202290255r37,"com.google.appengine.eclipse.sdkbundle",1331397104666
+stopped,bundle,com.google.gdt.eclipse.appengine.rpc,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.appengine.rpc",1331397104666
+stopped,bundle,com.google.gdt.eclipse.gph.e36,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.e36",1331397104666
+stopped,bundle,com.google.gdt.eclipse.gph.hge,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.hge",1331397104666
+stopped,bundle,com.google.gdt.eclipse.gph.subclipse,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.subclipse",1331397104666
+stopped,bundle,com.google.gdt.eclipse.gph.subversive,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.subversive",1331397104666
+stopped,bundle,com.google.gdt.eclipse.suite.ext,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.suite.ext",1331397104666
+stopped,bundle,com.google.gdt.eclipse.gph,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph",1331397104666
+stopped,bundle,com.google.gdt.eclipse.maven.e37,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.maven.e37",1331397104666
+stopped,bundle,com.google.gdt.eclipse.maven,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.maven",1331397104667
+stopped,bundle,com.google.gdt.eclipse.suite,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.suite",1331397104667
+stopped,bundle,com.google.gdt.eclipse.appsmarketplace,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.appsmarketplace",1331397104667
+stopped,bundle,com.google.appengine.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.appengine.eclipse.core",1331397104667
+stopped,bundle,com.google.gdt.eclipse.login,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.login",1331397104669
+stopped,bundle,com.google.gdt.eclipse.managedapis,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.managedapis",1331397104670
+stopped,bundle,com.google.gwt.eclipse.oophm,2.5.2.v201202290255-rel-r37,"com.google.gwt.eclipse.oophm",1331397104670
+stopped,bundle,com.google.gwt.eclipse.sdkbundle,2.4.0.v201202290255-rel-r37,"com.google.gwt.eclipse.sdkbundle",1331397104670
+stopped,bundle,com.google.gwt.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.gwt.eclipse.core",1331397104788
+stopped,bundle,com.google.gdt.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.core",1331397104788
+stopped,bundle,com.google.gdt.eclipse.platform,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform",1331397104788
+stopped,bundle,com.google.gdt.eclipse.platform.e37,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform.e37",1331397104789
+stopped,bundle,org.eclipse.m2e.discovery,1.0.200.20111228-1245,"org.eclipse.m2e.discovery",1331397104789
+stopped,bundle,org.eclipse.m2e.refactoring,1.0.200.20111228-1245,"org.eclipse.m2e.refactoring",1331397104789
+stopped,bundle,org.eclipse.m2e.editor,1.0.200.20111228-1245,"org.eclipse.m2e.editor",1331397104790
+stopped,bundle,org.eclipse.m2e.editor.xml,1.0.200.20111228-1245,"org.eclipse.m2e.editor.xml",1331397104790
+stopped,bundle,org.eclipse.m2e.jdt,1.0.200.20111228-1245,"org.eclipse.m2e.jdt",1331397104790
+stopped,bundle,org.eclipse.m2e.launching,1.0.200.20111228-1245,"org.eclipse.m2e.launching",1331397104790
+stopped,bundle,org.eclipse.m2e.usagedata,1.0.200.20111228-1245,"org.eclipse.m2e.usagedata",1331397104790
+stopped,bundle,org.eclipse.m2e.core.ui,1.0.200.20111228-1245,"org.eclipse.m2e.core.ui",1331397104790
+stopped,bundle,org.eclipse.m2e.core,1.0.200.20111228-1245,"org.eclipse.m2e.core",1331397104790
+stopped,bundle,org.eclipse.mylyn.ide.ant,3.6.0.v20110608-1400,"org.eclipse.mylyn.ide.ant",1331397104790
+stopped,bundle,org.eclipse.ant.ui,3.5.100.v20110510,"org.eclipse.ant.ui",1331397104830
+stopped,bundle,org.eclipse.ant.launching,1.0.100.v20110506,"org.eclipse.ant.launching",1331397104830
+stopped,bundle,org.eclipse.equinox.p2.ui.sdk,1.0.200.v20110502-1955,"org.eclipse.equinox.p2.ui.sdk",1331397104830
+stopped,bundle,org.eclipse.mylyn.java.tasks,3.6.0.v20110608-1400,"org.eclipse.mylyn.java.tasks",1331397104830
+stopped,bundle,org.eclipse.mylyn.java.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.java.ui",1331397104831
+stopped,bundle,com.google.gdt.eclipse.designer.UiBinder,2.5.0.r37x201112291029,"com.google.gdt.eclipse.designer.UiBinder",1331397104831
+stopped,bundle,com.google.gdt.eclipse.designer.gpe,2.5.0.r37x201201030222,"com.google.gdt.eclipse.designer.gpe",1331397104831
+stopped,bundle,com.google.gdt.eclipse.designer,2.5.0.r37x201112291029,"com.google.gdt.eclipse.designer",1331397104832
+stopped,bundle,org.eclipse.jdt.junit,3.7.0.v20110505-0800,"org.eclipse.jdt.junit",1331397104832
+stopped,bundle,org.eclipse.jdt.apt.ui,3.3.300.v20110305-1450,"org.eclipse.jdt.apt.ui",1331397104832
+stopped,bundle,org.eclipse.jdt.debug.ui,3.6.0.v20110512,"org.eclipse.jdt.debug.ui",1331397104834
+stopped,bundle,com.google.gdt.eclipse.platform.shared,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform.shared",1331397104834
+stopped,bundle,org.eclipse.wb.swing.FormLayout,1.0.0.r37x201106081552,"org.eclipse.wb.swing.FormLayout",1331397104834
+stopped,bundle,org.eclipse.wb.swing.MigLayout,1.0.0.r37x201106081552,"org.eclipse.wb.swing.MigLayout",1331397104835
+stopped,bundle,org.eclipse.wb.swing.databinding,1.0.0.r37x201106081552,"org.eclipse.wb.swing.databinding",1331397104835
+stopped,bundle,org.eclipse.wb.swing.java6,1.0.0.r37x201106081552,"org.eclipse.wb.swing.java6",1331397104835
+stopped,bundle,org.eclipse.wb.swing.jsr296,1.0.0.r37x201106081552,"org.eclipse.wb.swing.jsr296",1331397104835
+stopped,bundle,org.eclipse.wb.swing,1.0.0.r37x201106081552,"org.eclipse.wb.swing",1331397104835
+stopped,bundle,org.eclipse.wb.core.ui,1.0.0.r37x201106081733,"org.eclipse.wb.core.ui",1331397104835
+stopped,bundle,org.eclipse.wb.layout.group,1.0.0.r37x201106081642,"org.eclipse.wb.layout.group",1331397104835
+stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_0.webkit,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_0.webkit",1331397104835
+stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_0,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_0",1331397104835
+stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_2.webkit,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_2.webkit",1331397104835
+stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_2,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_2",1331397104835
+stopped,bundle,com.google.gdt.eclipse.designer.hosted,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted",1331397104835
+stopped,bundle,org.eclipse.wb.core.databinding.xml,1.2.0.r37x201112291009,"org.eclipse.wb.core.databinding.xml",1331397104835
+stopped,bundle,org.eclipse.wb.core.databinding,1.2.0.r37x201112290923,"org.eclipse.wb.core.databinding",1331397104835
+stopped,bundle,org.eclipse.wb.core.xml,1.2.0.r37x201112291009,"org.eclipse.wb.core.xml",1331397104835
+stopped,bundle,org.eclipse.wb.css,1.2.0.r37x201112290951,"org.eclipse.wb.css",1331397104835
+stopped,bundle,org.eclipse.wb.os.macosx,1.2.0.r37x201112290923,"org.eclipse.wb.os.macosx",1331397104835
+stopped,bundle,org.eclipse.wb.core,1.2.0.r37x201112290923,"org.eclipse.wb.core",1331397104836
+stopped,bundle,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui",1331397104842
+stopped,bundle,org.eclipse.wst.dtd.ui,1.0.600.v201103171359,"org.eclipse.wst.dtd.ui",1331397104842
+stopped,bundle,org.eclipse.wst.xsd.ui,1.2.404.v201105050216,"org.eclipse.wst.xsd.ui",1331397104842
+stopped,bundle,org.eclipse.wst.css.ui,1.0.601.v201201101544,"org.eclipse.wst.css.ui",1331397104843
+stopped,bundle,org.eclipse.wst.xml.ui,1.1.202.v201112071516,"org.eclipse.wst.xml.ui",1331397104843
+stopped,bundle,org.eclipse.wst.common.ui,1.1.500.v200911190730,"org.eclipse.wst.common.ui",1331397104843
+stopped,bundle,org.eclipse.wst.jsdt.ui,1.1.102.v201201131900,"org.eclipse.wst.jsdt.ui",1331397104868
+stopped,bundle,org.eclipse.wst.sse.ui,1.3.2.v201201041522,"org.eclipse.wst.sse.ui",1331397104868
+stopped,bundle,org.eclipse.search,3.7.0.v20110505-0800,"org.eclipse.search",1331397104902
+stopped,bundle,org.eclipse.mylyn.commons.team,0.8.0.v20110608-1400,"org.eclipse.mylyn.commons.team",1331397104902
+stopped,bundle,org.eclipse.mylyn.team.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.team.ui",1331397104904
+stopped,bundle,org.eclipse.ui.navigator.resources,3.4.300.I20110421-1800,"org.eclipse.ui.navigator.resources",1331397104904
+stopped,bundle,org.eclipse.ltk.ui.refactoring,3.6.0.v20110505-0800,"org.eclipse.ltk.ui.refactoring",1331397104904
+stopped,bundle,org.eclipse.mylyn.bugzilla.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.bugzilla.ui",1331397104904
+stopped,bundle,org.eclipse.mylyn.ide.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.ide.ui",1331397104904
+stopped,bundle,org.eclipse.mylyn.resources.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.resources.ui",1331397104904
+stopped,bundle,org.eclipse.mylyn.wikitext.tasks.ui,1.5.0.v20110608-1400,"org.eclipse.mylyn.wikitext.tasks.ui",1331397104904
+stopped,bundle,org.eclipse.mylyn.context.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.context.ui",1331397104905
+stopped,bundle,org.eclipse.mylyn.help.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.help.ui",1331397104905
+stopped,bundle,org.eclipse.mylyn.tasks.bugs,3.6.0.v20110608-1400,"org.eclipse.mylyn.tasks.bugs",1331397104905
+stopped,bundle,org.eclipse.mylyn.tasks.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.tasks.ui",1331397104905
+stopped,bundle,org.eclipse.team.cvs.ui,3.3.400.I20110510-0800,"org.eclipse.team.cvs.ui",1331397104906
+stopped,bundle,org.eclipse.team.ui,3.6.100.I20110525-0800,"org.eclipse.team.ui",1331397104906
+stopped,bundle,org.eclipse.compare,3.5.200.I20110525-0800,"org.eclipse.compare",1331397104906
+stopped,bundle,org.eclipse.ui.externaltools,3.2.0.v20110506,"org.eclipse.ui.externaltools",1331397104906
+stopped,bundle,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui",1331397104908
+stopped,bundle,org.eclipse.mylyn.wikitext.ui,1.5.0.v20110608-1400,"org.eclipse.mylyn.wikitext.ui",1331397104908
+stopped,bundle,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console",1331397104909
+activated,perspective,org.eclipse.jdt.ui,,"org.eclipse.jdt.ui.JavaPerspective",1331399343440
+started,bundle,org.eclipse.osgi,3.7.0.v20110613,"org.eclipse.osgi",1331399343441
+started,bundle,org.eclipse.equinox.simpleconfigurator,1.0.200.v20110502-1955,"org.eclipse.equinox.simpleconfigurator",1331399343488
+started,bundle,com.ibm.icu,4.4.2.v20110208,"com.ibm.icu",1331399343497
+started,bundle,org.eclipse.compare.core,3.5.200.I20110208-0800,"org.eclipse.compare.core",1331399343504
+started,bundle,org.eclipse.core.contenttype,3.4.100.v20110423-0524,"org.eclipse.core.contenttype",1331399343516
+started,bundle,org.eclipse.core.databinding.observable,1.4.0.I20110222-0800,"org.eclipse.core.databinding.observable",1331399343558
+started,bundle,org.eclipse.core.expressions,3.4.300.v20110228,"org.eclipse.core.expressions",1331399343582
+started,bundle,org.eclipse.core.filebuffers,3.5.200.v20110505-0800,"org.eclipse.core.filebuffers",1331399343616
+started,bundle,org.eclipse.core.filesystem,1.3.100.v20110423-0524,"org.eclipse.core.filesystem",1331399343625
+started,bundle,org.eclipse.core.jobs,3.5.100.v20110404,"org.eclipse.core.jobs",1331399343636
+started,bundle,org.eclipse.core.net,1.2.100.I20110511-0800,"org.eclipse.core.net",1331399343655
+started,bundle,org.eclipse.core.resources,3.7.100.v20110510-0712,"org.eclipse.core.resources",1331399343711
+started,bundle,org.eclipse.core.runtime,3.7.0.v20110110,"org.eclipse.core.runtime",1331399343783
+started,bundle,org.eclipse.core.runtime.compatibility,3.2.100.v20100505,"org.eclipse.core.runtime.compatibility",1331399344041
+started,bundle,org.eclipse.core.runtime.compatibility.auth,3.2.200.v20110110,"org.eclipse.core.runtime.compatibility.auth",1331399344152
+started,bundle,org.eclipse.debug.core,3.7.0.v20110518,"org.eclipse.debug.core",1331399344238
+started,bundle,org.eclipse.epp.mpc.ui,1.1.0.I20110525-0742,"org.eclipse.epp.mpc.ui",1331399344366
+started,bundle,org.eclipse.epp.usagedata.gathering,1.3.1.R201106061540,"org.eclipse.epp.usagedata.gathering",1331399344431
+started,bundle,org.eclipse.epp.usagedata.recording,1.3.1.R201106061540,"org.eclipse.epp.usagedata.recording",1331399344515
+started,bundle,org.eclipse.equinox.app,1.3.100.v20110321,"org.eclipse.equinox.app",1331399344552
+started,bundle,org.eclipse.equinox.common,3.6.0.v20110523,"org.eclipse.equinox.common",1331399344616
+started,bundle,org.eclipse.equinox.ds,1.3.0.v20110502,"org.eclipse.equinox.ds",1331399344697
+started,bundle,org.eclipse.equinox.event,1.2.100.v20110502,"org.eclipse.equinox.event",1331399344747
+started,bundle,org.eclipse.equinox.p2.core,2.1.0.v20110502-1955,"org.eclipse.equinox.p2.core",1331399344770
+started,bundle,org.eclipse.equinox.p2.directorywatcher,1.0.300.v20110502-1955,"org.eclipse.equinox.p2.directorywatcher",1331399344787
+started,bundle,org.eclipse.equinox.p2.engine,2.1.0.v20110511,"org.eclipse.equinox.p2.engine",1331399344788
+started,bundle,org.eclipse.equinox.p2.metadata,2.1.0.v20110510,"org.eclipse.equinox.p2.metadata",1331399344844
+started,bundle,org.eclipse.equinox.p2.metadata.repository,1.2.0.v20110511-1359,"org.eclipse.equinox.p2.metadata.repository",1331399344865
+started,bundle,org.eclipse.equinox.p2.operations,2.1.0.v20110511-1821,"org.eclipse.equinox.p2.operations",1331399344925
+started,bundle,org.eclipse.equinox.p2.reconciler.dropins,1.1.100.v20110510,"org.eclipse.equinox.p2.reconciler.dropins",1331399345296
+started,bundle,org.eclipse.equinox.p2.repository,2.1.0.v20110601,"org.eclipse.equinox.p2.repository",1331399345372
+started,bundle,org.eclipse.equinox.p2.ui.sdk.scheduler,1.0.100.v20110502-1955,"org.eclipse.equinox.p2.ui.sdk.scheduler",1331399345380
+started,bundle,org.eclipse.equinox.p2.updatechecker,1.1.200.v20110502-1955,"org.eclipse.equinox.p2.updatechecker",1331399345474
+started,bundle,org.eclipse.equinox.preferences,3.4.0.v20110502,"org.eclipse.equinox.preferences",1331399345569
+started,bundle,org.eclipse.equinox.registry,3.5.100.v20110502,"org.eclipse.equinox.registry",1331399345673
+started,bundle,org.eclipse.equinox.security,1.1.0.v20110502,"org.eclipse.equinox.security",1331399345767
+started,bundle,org.eclipse.equinox.util,1.0.300.v20110502,"org.eclipse.equinox.util",1331399345814
+started,bundle,org.eclipse.help,3.5.100.v20110426,"org.eclipse.help",1331399345884
+started,bundle,org.eclipse.jdt.core,3.7.0.v_B61,"org.eclipse.jdt.core",1331399345924
+started,bundle,org.eclipse.jdt.core.manipulation,1.4.0.v20110505-0800,"org.eclipse.jdt.core.manipulation",1331399345937
+started,bundle,org.eclipse.jdt.launching,3.6.0.v20110509,"org.eclipse.jdt.launching",1331399345971
+started,bundle,org.eclipse.jdt.launching.macosx,3.2.100.v20110509,"org.eclipse.jdt.launching.macosx",1331399346042
+started,bundle,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui",1331399346042
+started,bundle,org.eclipse.jface,3.7.0.I20110522-1430,"org.eclipse.jface",1331399346057
+started,bundle,org.eclipse.jsch.core,1.1.300.I20110514-0800,"org.eclipse.jsch.core",1331399346224
+started,bundle,org.eclipse.ltk.core.refactoring,3.5.200.v20110505-0800,"org.eclipse.ltk.core.refactoring",1331399346241
+started,bundle,org.eclipse.ltk.ui.refactoring,3.6.0.v20110505-0800,"org.eclipse.ltk.ui.refactoring",1331399346288
+started,bundle,org.eclipse.m2e.logback.configuration,1.0.0.20110607-2117,"org.eclipse.m2e.logback.configuration",1331399346302
+started,bundle,org.eclipse.mylyn.bugzilla.core,3.6.0.v20110608-1400,"org.eclipse.mylyn.bugzilla.core",1331399346339
+started,bundle,org.eclipse.mylyn.bugzilla.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.bugzilla.ui",1331399346373
+started,bundle,org.eclipse.mylyn.commons.identity,0.8.0.v20110608-1400,"org.eclipse.mylyn.commons.identity",1331399346383
+started,bundle,org.eclipse.mylyn.commons.net,3.6.0.v20110608-1400,"org.eclipse.mylyn.commons.net",1331399346383
+started,bundle,org.eclipse.mylyn.context.core,3.6.0.v20110608-1400,"org.eclipse.mylyn.context.core",1331399346395
+started,bundle,org.eclipse.mylyn.context.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.context.ui",1331399346439
+started,bundle,org.eclipse.mylyn.monitor.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.monitor.ui",1331399346459
+started,bundle,org.eclipse.mylyn.tasks.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.tasks.ui",1331399346576
+started,bundle,org.eclipse.mylyn.team.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.team.ui",1331399346640
+started,bundle,org.eclipse.search,3.7.0.v20110505-0800,"org.eclipse.search",1331399346654
+started,bundle,org.eclipse.team.core,3.6.0.I20110525-0800,"org.eclipse.team.core",1331399346686
+started,bundle,org.eclipse.team.cvs.core,3.3.400.I20110510-0800,"org.eclipse.team.cvs.core",1331399346777
+started,bundle,org.eclipse.team.ui,3.6.100.I20110525-0800,"org.eclipse.team.ui",1331399346790
+started,bundle,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui",1331399346852
+started,bundle,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console",1331399346873
+started,bundle,org.eclipse.ui.editors,3.7.0.v20110517-0800,"org.eclipse.ui.editors",1331399346873
+started,bundle,org.eclipse.ui.forms,3.5.100.v20110425,"org.eclipse.ui.forms",1331399346927
+started,bundle,org.eclipse.ui.ide,3.7.0.I20110519-0100,"org.eclipse.ui.ide",1331399347010
+started,bundle,org.eclipse.ui.net,1.2.100.I20110511-0800,"org.eclipse.ui.net",1331399347038
+started,bundle,org.eclipse.ui.views,3.6.0.I20110412-0800,"org.eclipse.ui.views",1331399347040
+started,bundle,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"org.eclipse.ui.workbench",1331399347054
+started,bundle,org.eclipse.ui.workbench.texteditor,3.7.0.v20110505-0800,"org.eclipse.ui.workbench.texteditor",1331399347077
+started,bundle,org.eclipse.update.configurator,3.3.100.v20100512,"org.eclipse.update.configurator",1331399347118
+started,bundle,org.eclipse.update.core,3.2.500.v20110330,"org.eclipse.update.core",1331399347143
+started,bundle,com.google.appengine.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.appengine.eclipse.core",1331399347143
+started,bundle,com.google.gdt.eclipse.appengine.rpc,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.appengine.rpc",1331399347149
+started,bundle,com.google.gdt.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.core",1331399347150
+started,bundle,com.google.gdt.eclipse.designer,2.5.0.r37x201112291029,"com.google.gdt.eclipse.designer",1331399347189
+started,bundle,com.google.gdt.eclipse.login,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.login",1331399347190
+started,bundle,com.google.gdt.eclipse.managedapis,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.managedapis",1331399347190
+started,bundle,com.google.gdt.eclipse.platform.e37,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform.e37",1331399347205
+started,bundle,com.google.gdt.eclipse.platform.shared,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform.shared",1331399347205
+started,bundle,com.google.gdt.eclipse.suite.ext,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.suite.ext",1331399347205
+started,bundle,com.google.gwt.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.gwt.eclipse.core",1331399347264
+started,bundle,org.eclipse.mylyn.commons.ui,3.6.1.v20110720-0100,"org.eclipse.mylyn.commons.ui",1331399347273
+started,bundle,org.eclipse.wb.core,1.2.0.r37x201112290923,"org.eclipse.wb.core",1331399347298
+started,bundle,org.eclipse.wb.core.lib,1.2.0.r37x201112290923,"org.eclipse.wb.core.lib",1331399347312
+os,sysinfo,,,"macosx",1331399347316
+arch,sysinfo,,,"x86_64",1331399347316
+ws,sysinfo,,,"cocoa",1331399347316
+locale,sysinfo,,,"ja_JP",1331399347316
+processors,sysinfo,,,"8",1331399347316
+java.runtime.name,sysinfo,,,"Java(TM) SE Runtime Environment",1331399347316
+java.runtime.version,sysinfo,,,"1.6.0_29-b11-402-11D50d",1331399347316
+java.specification.name,sysinfo,,,"Java Platform API Specification",1331399347316
+java.specification.vendor,sysinfo,,,"Sun Microsystems Inc.",1331399347316
+java.specification.version,sysinfo,,,"1.6",1331399347316
+java.vendor,sysinfo,,,"Apple Inc.",1331399347316
+java.version,sysinfo,,,"1.6.0_29",1331399347316
+java.vm.info,sysinfo,,,"mixed mode",1331399347316
+java.vm.name,sysinfo,,,"Java HotSpot(TM) 64-Bit Server VM",1331399347316
+java.vm.specification.name,sysinfo,,,"Java Virtual Machine Specification",1331399347316
+java.vm.specification.vendor,sysinfo,,,"Sun Microsystems Inc.",1331399347316
+java.vm.specification.version,sysinfo,,,"1.0",1331399347316
+java.vm.vendor,sysinfo,,,"Apple Inc.",1331399347316
+java.vm.version,sysinfo,,,"20.4-b02-402",1331399347316
+started,bundle,org.eclipse.m2e.usagedata,1.0.200.20111228-1245,"org.eclipse.m2e.usagedata",1331399347342
+opened,view,org.eclipse.ui.ide,3.7.0.I20110519-0100,"org.eclipse.ui.views.ProblemView",1331399347967
+started,bundle,org.eclipse.update.scheduler,3.2.300.v20100512,"org.eclipse.update.scheduler",1331399348241
+started,bundle,org.eclipse.wb.discovery.core,1.0.0.r37x201106081733,"org.eclipse.wb.discovery.core",1331399348404
+started,bundle,org.eclipse.wb.discovery.ui,1.0.0.r37x201106081733,"org.eclipse.wb.discovery.ui",1331399350282
+started,bundle,com.google.gdt.eclipse.designer.hosted,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted",1331399350414
+started,bundle,com.google.gdt.eclipse.designer.UiBinder,2.5.0.r37x201112291029,"com.google.gdt.eclipse.designer.UiBinder",1331399350608
+started,bundle,com.google.gdt.eclipse.maven,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.maven",1331399353338
+started,bundle,com.google.gdt.eclipse.suite,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.suite",1331399353468
+started,bundle,org.eclipse.core.variables,3.2.500.v20110511,"org.eclipse.core.variables",1331399353587
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331399387400
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331399387407
+opened,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331399394093
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331399394171
+executed,command,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.edit.text.java.open.editor",1331399394231
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331399416912
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331399417951
+started,bundle,org.eclipse.jdt.junit,3.7.0.v20110505-0800,"org.eclipse.jdt.junit",1331399418814
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331399438689
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331399439664
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331399459724
+started,bundle,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui",1331399460211
+started,bundle,org.eclipse.jdt.debug,3.7.0.v20110509,"org.eclipse.jdt.debug",1331399460460
+started,bundle,org.eclipse.jdt.debug.ui,3.6.0.v20110512,"org.eclipse.jdt.debug.ui",1331399460520
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331399572725
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331399577122
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331399578919
+closed,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331399579212
+started,bundle,org.eclipse.compare,3.5.200.I20110525-0800,"org.eclipse.compare",1331399579866
+stopped,bundle,org.eclipse.m2e.logback.configuration,1.0.0.20110607-2117,"org.eclipse.m2e.logback.configuration",1331399580278
+stopped,bundle,org.eclipse.ui.cheatsheets,3.4.100.v20110425,"org.eclipse.ui.cheatsheets",1331399580278
+stopped,bundle,org.eclipse.help.ui,3.5.100.v20110425,"org.eclipse.help.ui",1331399580278
+stopped,bundle,org.eclipse.help.webapp,3.6.0.v20110518,"org.eclipse.help.webapp",1331399580278
+stopped,bundle,org.eclipse.epp.mpc.ui,1.1.0.I20110525-0742,"org.eclipse.epp.mpc.ui",1331399580279
+stopped,bundle,org.eclipse.epp.usagedata.ui,1.3.1.R201106061540,"org.eclipse.epp.usagedata.ui",1331399580279
+stopped,bundle,org.eclipse.ui.intro.universal,3.2.500.v20110510,"org.eclipse.ui.intro.universal",1331399580279
+stopped,bundle,org.eclipse.ui.intro,3.4.100.v20110425,"org.eclipse.ui.intro",1331399580279
+stopped,bundle,org.eclipse.help.base,3.6.0.v201106131736,"org.eclipse.help.base",1331399580279
+stopped,bundle,org.eclipse.equinox.http.jetty,2.0.100.v20110502,"org.eclipse.equinox.http.jetty",1331399580280
+stopped,bundle,com.google.appengine.eclipse.datatools,2.5.2.v201202290255-rel-r37,"com.google.appengine.eclipse.datatools",1331399580280
+stopped,bundle,com.google.appengine.eclipse.sdkbundle,1.6.3.v201202290255r37,"com.google.appengine.eclipse.sdkbundle",1331399580280
+stopped,bundle,com.google.gdt.eclipse.appengine.rpc,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.appengine.rpc",1331399580281
+stopped,bundle,com.google.gdt.eclipse.gph.e36,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.e36",1331399580281
+stopped,bundle,com.google.gdt.eclipse.gph.hge,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.hge",1331399580281
+stopped,bundle,com.google.gdt.eclipse.gph.subclipse,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.subclipse",1331399580281
diff --git a/workspace/.metadata/.plugins/org.eclipse.epp.usagedata.recording/upload2.csv b/workspace/.metadata/.plugins/org.eclipse.epp.usagedata.recording/upload2.csv
new file mode 100644 (file)
index 0000000..662af14
--- /dev/null
@@ -0,0 +1,243 @@
+what,kind,bundleId,bundleVersion,description,time
+stopped,bundle,com.google.gdt.eclipse.gph.subversive,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.subversive",1331399580281
+stopped,bundle,com.google.gdt.eclipse.suite.ext,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.suite.ext",1331399580281
+stopped,bundle,com.google.gdt.eclipse.gph,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph",1331399580281
+stopped,bundle,com.google.gdt.eclipse.maven.e37,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.maven.e37",1331399580281
+stopped,bundle,com.google.gdt.eclipse.maven,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.maven",1331399580282
+stopped,bundle,com.google.gdt.eclipse.suite,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.suite",1331399580282
+stopped,bundle,com.google.gdt.eclipse.appsmarketplace,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.appsmarketplace",1331399580282
+stopped,bundle,com.google.appengine.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.appengine.eclipse.core",1331399580282
+stopped,bundle,com.google.gdt.eclipse.login,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.login",1331399580282
+stopped,bundle,com.google.gdt.eclipse.managedapis,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.managedapis",1331399580306
+stopped,bundle,com.google.gwt.eclipse.oophm,2.5.2.v201202290255-rel-r37,"com.google.gwt.eclipse.oophm",1331399580306
+stopped,bundle,com.google.gwt.eclipse.sdkbundle,2.4.0.v201202290255-rel-r37,"com.google.gwt.eclipse.sdkbundle",1331399580306
+stopped,bundle,com.google.gwt.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.gwt.eclipse.core",1331399580437
+stopped,bundle,com.google.gdt.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.core",1331399580437
+stopped,bundle,com.google.gdt.eclipse.platform,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform",1331399580437
+stopped,bundle,com.google.gdt.eclipse.platform.e37,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform.e37",1331399580437
+stopped,bundle,org.eclipse.m2e.discovery,1.0.200.20111228-1245,"org.eclipse.m2e.discovery",1331399580438
+stopped,bundle,org.eclipse.m2e.refactoring,1.0.200.20111228-1245,"org.eclipse.m2e.refactoring",1331399580438
+stopped,bundle,org.eclipse.m2e.editor,1.0.200.20111228-1245,"org.eclipse.m2e.editor",1331399580438
+stopped,bundle,org.eclipse.m2e.editor.xml,1.0.200.20111228-1245,"org.eclipse.m2e.editor.xml",1331399580439
+stopped,bundle,org.eclipse.m2e.jdt,1.0.200.20111228-1245,"org.eclipse.m2e.jdt",1331399580439
+stopped,bundle,org.eclipse.m2e.launching,1.0.200.20111228-1245,"org.eclipse.m2e.launching",1331399580439
+stopped,bundle,org.eclipse.m2e.usagedata,1.0.200.20111228-1245,"org.eclipse.m2e.usagedata",1331399580439
+stopped,bundle,org.eclipse.m2e.core.ui,1.0.200.20111228-1245,"org.eclipse.m2e.core.ui",1331399580439
+stopped,bundle,org.eclipse.m2e.core,1.0.200.20111228-1245,"org.eclipse.m2e.core",1331399580439
+stopped,bundle,org.eclipse.mylyn.ide.ant,3.6.0.v20110608-1400,"org.eclipse.mylyn.ide.ant",1331399580439
+stopped,bundle,org.eclipse.ant.ui,3.5.100.v20110510,"org.eclipse.ant.ui",1331399580439
+stopped,bundle,org.eclipse.ant.launching,1.0.100.v20110506,"org.eclipse.ant.launching",1331399580440
+stopped,bundle,org.eclipse.equinox.p2.ui.sdk,1.0.200.v20110502-1955,"org.eclipse.equinox.p2.ui.sdk",1331399580440
+stopped,bundle,org.eclipse.mylyn.java.tasks,3.6.0.v20110608-1400,"org.eclipse.mylyn.java.tasks",1331399580440
+stopped,bundle,org.eclipse.mylyn.java.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.java.ui",1331399580440
+stopped,bundle,com.google.gdt.eclipse.designer.UiBinder,2.5.0.r37x201112291029,"com.google.gdt.eclipse.designer.UiBinder",1331399580441
+stopped,bundle,com.google.gdt.eclipse.designer.gpe,2.5.0.r37x201201030222,"com.google.gdt.eclipse.designer.gpe",1331399580441
+stopped,bundle,com.google.gdt.eclipse.designer,2.5.0.r37x201112291029,"com.google.gdt.eclipse.designer",1331399580442
+stopped,bundle,org.eclipse.jdt.junit,3.7.0.v20110505-0800,"org.eclipse.jdt.junit",1331399580442
+stopped,bundle,org.eclipse.jdt.apt.ui,3.3.300.v20110305-1450,"org.eclipse.jdt.apt.ui",1331399580442
+stopped,bundle,org.eclipse.jdt.debug.ui,3.6.0.v20110512,"org.eclipse.jdt.debug.ui",1331399580464
+stopped,bundle,com.google.gdt.eclipse.platform.shared,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform.shared",1331399580465
+stopped,bundle,org.eclipse.wb.swing.FormLayout,1.0.0.r37x201106081552,"org.eclipse.wb.swing.FormLayout",1331399580465
+stopped,bundle,org.eclipse.wb.swing.MigLayout,1.0.0.r37x201106081552,"org.eclipse.wb.swing.MigLayout",1331399580465
+stopped,bundle,org.eclipse.wb.swing.databinding,1.0.0.r37x201106081552,"org.eclipse.wb.swing.databinding",1331399580465
+stopped,bundle,org.eclipse.wb.swing.java6,1.0.0.r37x201106081552,"org.eclipse.wb.swing.java6",1331399580465
+stopped,bundle,org.eclipse.wb.swing.jsr296,1.0.0.r37x201106081552,"org.eclipse.wb.swing.jsr296",1331399580465
+stopped,bundle,org.eclipse.wb.swing,1.0.0.r37x201106081552,"org.eclipse.wb.swing",1331399580465
+stopped,bundle,org.eclipse.wb.core.ui,1.0.0.r37x201106081733,"org.eclipse.wb.core.ui",1331399580465
+stopped,bundle,org.eclipse.wb.layout.group,1.0.0.r37x201106081642,"org.eclipse.wb.layout.group",1331399580465
+stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_0.webkit,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_0.webkit",1331399580465
+stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_0,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_0",1331399580465
+stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_2.webkit,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_2.webkit",1331399580465
+stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_2,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_2",1331399580465
+stopped,bundle,com.google.gdt.eclipse.designer.hosted,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted",1331399580465
+stopped,bundle,org.eclipse.wb.core.databinding.xml,1.2.0.r37x201112291009,"org.eclipse.wb.core.databinding.xml",1331399580465
+stopped,bundle,org.eclipse.wb.core.databinding,1.2.0.r37x201112290923,"org.eclipse.wb.core.databinding",1331399580465
+stopped,bundle,org.eclipse.wb.core.xml,1.2.0.r37x201112291009,"org.eclipse.wb.core.xml",1331399580465
+stopped,bundle,org.eclipse.wb.css,1.2.0.r37x201112290951,"org.eclipse.wb.css",1331399580465
+stopped,bundle,org.eclipse.wb.os.macosx,1.2.0.r37x201112290923,"org.eclipse.wb.os.macosx",1331399580466
+stopped,bundle,org.eclipse.wb.core,1.2.0.r37x201112290923,"org.eclipse.wb.core",1331399580466
+stopped,bundle,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui",1331399580500
+stopped,bundle,org.eclipse.wst.dtd.ui,1.0.600.v201103171359,"org.eclipse.wst.dtd.ui",1331399580500
+stopped,bundle,org.eclipse.wst.xsd.ui,1.2.404.v201105050216,"org.eclipse.wst.xsd.ui",1331399580500
+stopped,bundle,org.eclipse.wst.css.ui,1.0.601.v201201101544,"org.eclipse.wst.css.ui",1331399580500
+stopped,bundle,org.eclipse.wst.xml.ui,1.1.202.v201112071516,"org.eclipse.wst.xml.ui",1331399580500
+stopped,bundle,org.eclipse.wst.common.ui,1.1.500.v200911190730,"org.eclipse.wst.common.ui",1331399580500
+stopped,bundle,org.eclipse.wst.jsdt.ui,1.1.102.v201201131900,"org.eclipse.wst.jsdt.ui",1331399580500
+stopped,bundle,org.eclipse.wst.sse.ui,1.3.2.v201201041522,"org.eclipse.wst.sse.ui",1331399580500
+stopped,bundle,org.eclipse.search,3.7.0.v20110505-0800,"org.eclipse.search",1331399580518
+stopped,bundle,org.eclipse.mylyn.commons.team,0.8.0.v20110608-1400,"org.eclipse.mylyn.commons.team",1331399580518
+stopped,bundle,org.eclipse.mylyn.team.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.team.ui",1331399580518
+stopped,bundle,org.eclipse.ui.navigator.resources,3.4.300.I20110421-1800,"org.eclipse.ui.navigator.resources",1331399580518
+stopped,bundle,org.eclipse.ltk.ui.refactoring,3.6.0.v20110505-0800,"org.eclipse.ltk.ui.refactoring",1331399580518
+stopped,bundle,org.eclipse.mylyn.bugzilla.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.bugzilla.ui",1331399580518
+stopped,bundle,org.eclipse.mylyn.ide.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.ide.ui",1331399580518
+stopped,bundle,org.eclipse.mylyn.resources.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.resources.ui",1331399580518
+stopped,bundle,org.eclipse.mylyn.wikitext.tasks.ui,1.5.0.v20110608-1400,"org.eclipse.mylyn.wikitext.tasks.ui",1331399580518
+stopped,bundle,org.eclipse.mylyn.context.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.context.ui",1331399580519
+stopped,bundle,org.eclipse.mylyn.help.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.help.ui",1331399580519
+stopped,bundle,org.eclipse.mylyn.tasks.bugs,3.6.0.v20110608-1400,"org.eclipse.mylyn.tasks.bugs",1331399580519
+stopped,bundle,org.eclipse.mylyn.tasks.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.tasks.ui",1331399580519
+stopped,bundle,org.eclipse.team.cvs.ui,3.3.400.I20110510-0800,"org.eclipse.team.cvs.ui",1331399580519
+stopped,bundle,org.eclipse.team.ui,3.6.100.I20110525-0800,"org.eclipse.team.ui",1331399580520
+stopped,bundle,org.eclipse.compare,3.5.200.I20110525-0800,"org.eclipse.compare",1331399580520
+stopped,bundle,org.eclipse.ui.externaltools,3.2.0.v20110506,"org.eclipse.ui.externaltools",1331399580520
+stopped,bundle,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui",1331399580537
+stopped,bundle,org.eclipse.mylyn.wikitext.ui,1.5.0.v20110608-1400,"org.eclipse.mylyn.wikitext.ui",1331399580537
+stopped,bundle,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console",1331399580538
+stopped,bundle,org.eclipse.mylyn.commons.ui,3.6.1.v20110720-0100,"org.eclipse.mylyn.commons.ui",1331399580538
+stopped,bundle,org.eclipse.ui.editors,3.7.0.v20110517-0800,"org.eclipse.ui.editors",1331399580538
+stopped,bundle,org.eclipse.wst.common.snippets,1.2.100.v201103281740,"org.eclipse.wst.common.snippets",1331399580538
+stopped,bundle,org.eclipse.ui.workbench.texteditor,3.7.0.v20110505-0800,"org.eclipse.ui.workbench.texteditor",1331399580538
+stopped,bundle,org.eclipse.compare.core,3.5.200.I20110208-0800,"org.eclipse.compare.core",1331399580538
+stopped,bundle,org.eclipse.emf.edit.ui,2.7.0.v20110606-0949,"org.eclipse.emf.edit.ui",1331399580538
+stopped,bundle,org.eclipse.gef,3.7.0.v20110407-2050,"org.eclipse.gef",1331399580538
+activated,perspective,org.eclipse.jdt.ui,,"org.eclipse.jdt.ui.JavaPerspective",1331424455535
+started,bundle,org.eclipse.osgi,3.7.0.v20110613,"org.eclipse.osgi",1331424455537
+started,bundle,org.eclipse.equinox.simpleconfigurator,1.0.200.v20110502-1955,"org.eclipse.equinox.simpleconfigurator",1331424455537
+started,bundle,com.ibm.icu,4.4.2.v20110208,"com.ibm.icu",1331424455537
+started,bundle,org.eclipse.compare.core,3.5.200.I20110208-0800,"org.eclipse.compare.core",1331424455537
+started,bundle,org.eclipse.core.contenttype,3.4.100.v20110423-0524,"org.eclipse.core.contenttype",1331424455537
+started,bundle,org.eclipse.core.databinding.observable,1.4.0.I20110222-0800,"org.eclipse.core.databinding.observable",1331424455537
+started,bundle,org.eclipse.core.expressions,3.4.300.v20110228,"org.eclipse.core.expressions",1331424455537
+started,bundle,org.eclipse.core.filebuffers,3.5.200.v20110505-0800,"org.eclipse.core.filebuffers",1331424455537
+started,bundle,org.eclipse.core.filesystem,1.3.100.v20110423-0524,"org.eclipse.core.filesystem",1331424455537
+started,bundle,org.eclipse.core.jobs,3.5.100.v20110404,"org.eclipse.core.jobs",1331424455538
+started,bundle,org.eclipse.core.net,1.2.100.I20110511-0800,"org.eclipse.core.net",1331424455538
+started,bundle,org.eclipse.core.resources,3.7.100.v20110510-0712,"org.eclipse.core.resources",1331424455538
+started,bundle,org.eclipse.core.runtime,3.7.0.v20110110,"org.eclipse.core.runtime",1331424455538
+started,bundle,org.eclipse.core.runtime.compatibility,3.2.100.v20100505,"org.eclipse.core.runtime.compatibility",1331424455538
+started,bundle,org.eclipse.core.runtime.compatibility.auth,3.2.200.v20110110,"org.eclipse.core.runtime.compatibility.auth",1331424455538
+started,bundle,org.eclipse.debug.core,3.7.0.v20110518,"org.eclipse.debug.core",1331424455538
+started,bundle,org.eclipse.epp.mpc.ui,1.1.0.I20110525-0742,"org.eclipse.epp.mpc.ui",1331424455538
+started,bundle,org.eclipse.epp.usagedata.gathering,1.3.1.R201106061540,"org.eclipse.epp.usagedata.gathering",1331424455538
+started,bundle,org.eclipse.epp.usagedata.recording,1.3.1.R201106061540,"org.eclipse.epp.usagedata.recording",1331424455538
+started,bundle,org.eclipse.equinox.app,1.3.100.v20110321,"org.eclipse.equinox.app",1331424455538
+started,bundle,org.eclipse.equinox.common,3.6.0.v20110523,"org.eclipse.equinox.common",1331424455538
+started,bundle,org.eclipse.equinox.ds,1.3.0.v20110502,"org.eclipse.equinox.ds",1331424455538
+started,bundle,org.eclipse.equinox.event,1.2.100.v20110502,"org.eclipse.equinox.event",1331424455538
+started,bundle,org.eclipse.equinox.p2.core,2.1.0.v20110502-1955,"org.eclipse.equinox.p2.core",1331424455538
+started,bundle,org.eclipse.equinox.p2.directorywatcher,1.0.300.v20110502-1955,"org.eclipse.equinox.p2.directorywatcher",1331424455538
+started,bundle,org.eclipse.equinox.p2.engine,2.1.0.v20110511,"org.eclipse.equinox.p2.engine",1331424455538
+started,bundle,org.eclipse.equinox.p2.metadata,2.1.0.v20110510,"org.eclipse.equinox.p2.metadata",1331424455538
+started,bundle,org.eclipse.equinox.p2.metadata.repository,1.2.0.v20110511-1359,"org.eclipse.equinox.p2.metadata.repository",1331424455538
+started,bundle,org.eclipse.equinox.p2.operations,2.1.0.v20110511-1821,"org.eclipse.equinox.p2.operations",1331424455538
+started,bundle,org.eclipse.equinox.p2.reconciler.dropins,1.1.100.v20110510,"org.eclipse.equinox.p2.reconciler.dropins",1331424455538
+started,bundle,org.eclipse.equinox.p2.repository,2.1.0.v20110601,"org.eclipse.equinox.p2.repository",1331424455538
+started,bundle,org.eclipse.equinox.p2.ui.sdk.scheduler,1.0.100.v20110502-1955,"org.eclipse.equinox.p2.ui.sdk.scheduler",1331424455538
+started,bundle,org.eclipse.equinox.p2.updatechecker,1.1.200.v20110502-1955,"org.eclipse.equinox.p2.updatechecker",1331424455538
+started,bundle,org.eclipse.equinox.preferences,3.4.0.v20110502,"org.eclipse.equinox.preferences",1331424455538
+started,bundle,org.eclipse.equinox.registry,3.5.100.v20110502,"org.eclipse.equinox.registry",1331424455538
+started,bundle,org.eclipse.equinox.security,1.1.0.v20110502,"org.eclipse.equinox.security",1331424455538
+started,bundle,org.eclipse.equinox.util,1.0.300.v20110502,"org.eclipse.equinox.util",1331424455538
+started,bundle,org.eclipse.help,3.5.100.v20110426,"org.eclipse.help",1331424455538
+started,bundle,org.eclipse.jdt.apt.core,3.3.500.v20110420-1015,"org.eclipse.jdt.apt.core",1331424455538
+started,bundle,org.eclipse.jdt.apt.pluggable.core,1.0.400.v20110305-1450,"org.eclipse.jdt.apt.pluggable.core",1331424455538
+started,bundle,org.eclipse.jdt.core,3.7.0.v_B61,"org.eclipse.jdt.core",1331424455538
+started,bundle,org.eclipse.jdt.core.manipulation,1.4.0.v20110505-0800,"org.eclipse.jdt.core.manipulation",1331424455553
+started,bundle,org.eclipse.jdt.junit,3.7.0.v20110505-0800,"org.eclipse.jdt.junit",1331424455607
+started,bundle,org.eclipse.jdt.launching,3.6.0.v20110509,"org.eclipse.jdt.launching",1331424455638
+started,bundle,org.eclipse.jdt.launching.macosx,3.2.100.v20110509,"org.eclipse.jdt.launching.macosx",1331424455645
+started,bundle,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui",1331424455645
+started,bundle,org.eclipse.jface,3.7.0.I20110522-1430,"org.eclipse.jface",1331424455660
+started,bundle,org.eclipse.jsch.core,1.1.300.I20110514-0800,"org.eclipse.jsch.core",1331424455690
+started,bundle,org.eclipse.ltk.core.refactoring,3.5.200.v20110505-0800,"org.eclipse.ltk.core.refactoring",1331424455715
+started,bundle,org.eclipse.ltk.ui.refactoring,3.6.0.v20110505-0800,"org.eclipse.ltk.ui.refactoring",1331424455778
+started,bundle,org.eclipse.m2e.logback.configuration,1.0.0.20110607-2117,"org.eclipse.m2e.logback.configuration",1331424455784
+started,bundle,org.eclipse.mylyn.bugzilla.core,3.6.0.v20110608-1400,"org.eclipse.mylyn.bugzilla.core",1331424455830
+started,bundle,org.eclipse.mylyn.bugzilla.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.bugzilla.ui",1331424455900
+started,bundle,org.eclipse.mylyn.commons.identity,0.8.0.v20110608-1400,"org.eclipse.mylyn.commons.identity",1331424455932
+started,bundle,org.eclipse.mylyn.commons.net,3.6.0.v20110608-1400,"org.eclipse.mylyn.commons.net",1331424455932
+started,bundle,org.eclipse.mylyn.context.core,3.6.0.v20110608-1400,"org.eclipse.mylyn.context.core",1331424455944
+started,bundle,org.eclipse.mylyn.context.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.context.ui",1331424455992
+started,bundle,org.eclipse.mylyn.monitor.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.monitor.ui",1331424456008
+started,bundle,org.eclipse.mylyn.tasks.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.tasks.ui",1331424456091
+started,bundle,org.eclipse.mylyn.team.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.team.ui",1331424456101
+started,bundle,org.eclipse.search,3.7.0.v20110505-0800,"org.eclipse.search",1331424456114
+started,bundle,org.eclipse.team.core,3.6.0.I20110525-0800,"org.eclipse.team.core",1331424456131
+started,bundle,org.eclipse.team.cvs.core,3.3.400.I20110510-0800,"org.eclipse.team.cvs.core",1331424456164
+started,bundle,org.eclipse.team.ui,3.6.100.I20110525-0800,"org.eclipse.team.ui",1331424456183
+started,bundle,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui",1331424456233
+started,bundle,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console",1331424456244
+started,bundle,org.eclipse.ui.editors,3.7.0.v20110517-0800,"org.eclipse.ui.editors",1331424456244
+started,bundle,org.eclipse.ui.forms,3.5.100.v20110425,"org.eclipse.ui.forms",1331424456286
+started,bundle,org.eclipse.ui.ide,3.7.0.I20110519-0100,"org.eclipse.ui.ide",1331424456391
+started,bundle,org.eclipse.ui.net,1.2.100.I20110511-0800,"org.eclipse.ui.net",1331424456408
+started,bundle,org.eclipse.ui.views,3.6.0.I20110412-0800,"org.eclipse.ui.views",1331424456467
+started,bundle,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"org.eclipse.ui.workbench",1331424456562
+started,bundle,org.eclipse.ui.workbench.texteditor,3.7.0.v20110505-0800,"org.eclipse.ui.workbench.texteditor",1331424456628
+started,bundle,org.eclipse.update.configurator,3.3.100.v20100512,"org.eclipse.update.configurator",1331424456677
+started,bundle,org.eclipse.update.core,3.2.500.v20110330,"org.eclipse.update.core",1331424456757
+started,bundle,com.google.appengine.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.appengine.eclipse.core",1331424456757
+started,bundle,com.google.gdt.eclipse.appengine.rpc,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.appengine.rpc",1331424456764
+started,bundle,com.google.gdt.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.core",1331424456765
+started,bundle,com.google.gdt.eclipse.designer,2.5.0.r37x201112291029,"com.google.gdt.eclipse.designer",1331424456826
+started,bundle,com.google.gdt.eclipse.login,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.login",1331424456827
+started,bundle,com.google.gdt.eclipse.managedapis,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.managedapis",1331424456828
+started,bundle,com.google.gdt.eclipse.platform.e37,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform.e37",1331424456876
+started,bundle,com.google.gdt.eclipse.platform.shared,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform.shared",1331424456877
+started,bundle,com.google.gdt.eclipse.suite.ext,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.suite.ext",1331424456877
+started,bundle,com.google.gwt.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.gwt.eclipse.core",1331424456901
+started,bundle,org.eclipse.mylyn.commons.ui,3.6.1.v20110720-0100,"org.eclipse.mylyn.commons.ui",1331424456920
+started,bundle,org.eclipse.wb.core,1.2.0.r37x201112290923,"org.eclipse.wb.core",1331424456958
+started,bundle,org.eclipse.wb.core.lib,1.2.0.r37x201112290923,"org.eclipse.wb.core.lib",1331424457011
+os,sysinfo,,,"macosx",1331424457015
+arch,sysinfo,,,"x86_64",1331424457015
+ws,sysinfo,,,"cocoa",1331424457015
+locale,sysinfo,,,"ja_JP",1331424457015
+processors,sysinfo,,,"8",1331424457015
+java.runtime.name,sysinfo,,,"Java(TM) SE Runtime Environment",1331424457015
+java.runtime.version,sysinfo,,,"1.6.0_29-b11-402-11D50d",1331424457015
+java.specification.name,sysinfo,,,"Java Platform API Specification",1331424457015
+java.specification.vendor,sysinfo,,,"Sun Microsystems Inc.",1331424457015
+java.specification.version,sysinfo,,,"1.6",1331424457015
+java.vendor,sysinfo,,,"Apple Inc.",1331424457015
+java.version,sysinfo,,,"1.6.0_29",1331424457015
+java.vm.info,sysinfo,,,"mixed mode",1331424457015
+java.vm.name,sysinfo,,,"Java HotSpot(TM) 64-Bit Server VM",1331424457015
+java.vm.specification.name,sysinfo,,,"Java Virtual Machine Specification",1331424457015
+java.vm.specification.vendor,sysinfo,,,"Sun Microsystems Inc.",1331424457015
+java.vm.specification.version,sysinfo,,,"1.0",1331424457015
+java.vm.vendor,sysinfo,,,"Apple Inc.",1331424457015
+java.vm.version,sysinfo,,,"20.4-b02-402",1331424457015
+started,bundle,org.eclipse.m2e.usagedata,1.0.200.20111228-1245,"org.eclipse.m2e.usagedata",1331424457051
+started,bundle,org.eclipse.update.scheduler,3.2.300.v20100512,"org.eclipse.update.scheduler",1331424457247
+started,bundle,org.eclipse.wb.discovery.core,1.0.0.r37x201106081733,"org.eclipse.wb.discovery.core",1331424457446
+opened,view,org.eclipse.ui.ide,3.7.0.I20110519-0100,"org.eclipse.ui.views.ProblemView",1331424458984
+started,bundle,org.eclipse.wb.discovery.ui,1.0.0.r37x201106081733,"org.eclipse.wb.discovery.ui",1331424459034
+started,bundle,com.google.gdt.eclipse.designer.hosted,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted",1331424459216
+started,bundle,com.google.gdt.eclipse.designer.UiBinder,2.5.0.r37x201112291029,"com.google.gdt.eclipse.designer.UiBinder",1331424459279
+started,bundle,com.google.gdt.eclipse.maven,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.maven",1331424460820
+started,bundle,com.google.gdt.eclipse.suite,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.suite",1331424460963
+started,bundle,org.eclipse.core.variables,3.2.500.v20110511,"org.eclipse.core.variables",1331424461068
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331424488367
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331424565590
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331424574208
+started,bundle,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui",1331424574997
+started,bundle,org.eclipse.jdt.debug,3.7.0.v20110509,"org.eclipse.jdt.debug",1331424575474
+started,bundle,org.eclipse.jdt.debug.ui,3.6.0.v20110512,"org.eclipse.jdt.debug.ui",1331424576085
+opened,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331424586216
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331424586351
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331424600481
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331424623282
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331424628733
+started,bundle,org.eclipse.m2e.launching,1.0.200.20111228-1245,"org.eclipse.m2e.launching",1331424634212
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331424636086
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331424639455
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331424642047
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331424648115
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331424651289
+started,bundle,org.eclipse.mylyn.java.tasks,3.6.0.v20110608-1400,"org.eclipse.mylyn.java.tasks",1331424653721
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331424653752
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331424659508
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331424662320
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331424665719
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331424669705
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331424770904
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331424871621
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331424917222
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331424919112
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331424930370
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331425229850
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331425234106
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331425235627
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331425245939
diff --git a/workspace/.metadata/.plugins/org.eclipse.epp.usagedata.recording/upload3.csv b/workspace/.metadata/.plugins/org.eclipse.epp.usagedata.recording/upload3.csv
new file mode 100644 (file)
index 0000000..c6d9e5d
--- /dev/null
@@ -0,0 +1,251 @@
+what,kind,bundleId,bundleVersion,description,time
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331425246608
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331425249106
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331425254047
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331425257378
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331425260088
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331425263795
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331425267000
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331425268865
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331425271358
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331425274728
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331425276921
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.undo",1331425284198
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331425290571
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331425294516
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331425297369
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331425304208
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331425307032
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331425310270
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331425312289
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331425315344
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331425317266
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331425319309
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331425322287
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331425325181
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331425328114
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331425331903
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425345991
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425513299
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425539096
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425590591
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425601607
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425607565
+opened,view,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.DebugView",1331425609055
+activated,view,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.DebugView",1331425609073
+opened,view,org.eclipse.ui.ide,3.7.0.I20110519-0100,"org.eclipse.ui.views.ProgressView",1331425611381
+activated,view,org.eclipse.ui.ide,3.7.0.I20110519-0100,"org.eclipse.ui.views.ProgressView",1331425611397
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331425612597
+opened,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331425615753
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331425615832
+executed,command,,,"AUTOGEN:::org.eclipse.jdt.debug.CompilationUnitEditor.BreakpointRulerActions/org.eclipse.jdt.debug.ui.actions.ManageBreakpointRulerAction",1331425642440
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425644510
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425653703
+executed,command,,,"AUTOGEN:::org.eclipse.jdt.debug.CompilationUnitEditor.BreakpointRulerActions/org.eclipse.jdt.debug.ui.actions.ManageBreakpointRulerAction",1331425657227
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425663381
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425663939
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425664475
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425664971
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425665435
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425665890
+started,bundle,org.eclipse.mylyn.ide.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.ide.ui",1331425669521
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425671747
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425672747
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425673323
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425674803
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425675323
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425675643
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425675909
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425676216
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425676456
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425676857
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425680731
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425680979
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425681191
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425681380
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425681623
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425682099
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425682299
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425682498
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425683219
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425683899
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425689667
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425690562
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425690881
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425691212
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425691355
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425691540
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425691863
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425692029
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331425692213
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.Resume",1331425693956
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331425697153
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331425706450
+executed,command,,,"AUTOGEN:::org.eclipse.jdt.debug.CompilationUnitEditor.BreakpointRulerActions/org.eclipse.jdt.debug.ui.actions.ManageBreakpointRulerAction",1331425706669
+executed,command,,,"AUTOGEN:::org.eclipse.jdt.debug.CompilationUnitEditor.BreakpointRulerActions/org.eclipse.jdt.debug.ui.actions.ManageBreakpointRulerAction",1331425715805
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425718365
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425783880
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425788925
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425796880
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331425818968
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331425821819
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331425826989
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331425829883
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331425830828
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331425837979
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331425848741
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425882157
+activated,view,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.DebugView",1331425908262
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425908309
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.Resume",1331425913431
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.Resume",1331425914167
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331425914437
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.Resume",1331425915071
+activated,view,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.DebugView",1331425915181
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.Resume",1331425915799
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331425916000
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331425951568
+executed,command,,,"AUTOGEN:::org.eclipse.jdt.internal.ui.CompilationUnitEditor.ruler.actions/org.eclipse.jdt.internal.ui.javaeditor.JavaSelectRulerAction",1331425952137
+executed,command,,,"AUTOGEN:::org.eclipse.jdt.internal.ui.CompilationUnitEditor.ruler.actions/org.eclipse.jdt.internal.ui.javaeditor.JavaSelectRulerAction",1331425952721
+executed,command,,,"AUTOGEN:::org.eclipse.jdt.debug.CompilationUnitEditor.BreakpointRulerActions/org.eclipse.jdt.debug.ui.actions.ManageBreakpointRulerAction",1331425953115
+executed,command,,,"AUTOGEN:::org.eclipse.jdt.debug.CompilationUnitEditor.BreakpointRulerActions/org.eclipse.jdt.debug.ui.actions.ManageBreakpointRulerAction",1331425955074
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331425960380
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426134365
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426144506
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426285651
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426290064
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426317442
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331426355281
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426369113
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426383346
+started,bundle,org.eclipse.mylyn.java.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.java.ui",1331426404495
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.cut",1331426414168
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331426421283
+executed,command,,,"AUTOGEN:::org.eclipse.jdt.internal.ui.CompilationUnitEditor.ruler.actions/org.eclipse.jdt.internal.ui.javaeditor.JavaSelectRulerAction",1331426429972
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426438231
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426506177
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331426510124
+executed,command,org.eclipse.ui.workbench.texteditor,3.7.0.v20110505-0800,"org.eclipse.ui.edit.text.delete.line",1331426520495
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331426520525
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.undo",1331426521342
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331426522759
+executed,command,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.edit.text.java.organize.imports",1331426523793
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331426525060
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426539126
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426572761
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331426575659
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426577581
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426646326
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331426650816
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.cut",1331426656317
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331426661468
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331426666715
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426667190
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426668946
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331426670066
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331426672649
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331426677369
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331426678474
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331426679275
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426690781
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426706134
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.undo",1331426707157
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331426707855
+executed,command,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.edit.text.java.organize.imports",1331426709189
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426713788
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426776718
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331426780865
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331426781768
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331426801844
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331426806306
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331426813916
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331426816778
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426827699
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426849052
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426906977
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426929132
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331426932354
+started,bundle,org.eclipse.wst.sse.core,1.1.602.v201112071516,"org.eclipse.wst.sse.core",1331426949040
+started,bundle,org.eclipse.wst.xml.core,1.1.602.v201201091944,"org.eclipse.wst.xml.core",1331426949159
+started,bundle,org.eclipse.wst.common.uriresolver,1.1.401.v201004280700,"org.eclipse.wst.common.uriresolver",1331426949261
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426949342
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426951471
+executed,command,com.google.appengine.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.appengine.eclipse.core.deployToGoogle",1331426953318
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331426972577
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331427016951
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331427020056
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331427332582
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331427473618
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331427790816
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331427799252
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331427802937
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331427819314
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331427822342
+executed,command,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.edit.text.java.organize.imports",1331427822500
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331427823819
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331427837312
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331427880154
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331427898061
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331427899288
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331427924539
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331427931490
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331427951764
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331428033341
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331428038731
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331428042069
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331428055965
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331428064106
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331428092288
+started,bundle,org.eclipse.compare,3.5.200.I20110525-0800,"org.eclipse.compare",1331428106776
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331428118571
+started,bundle,org.eclipse.wst.jsdt.manipulation,1.0.300.v201104272153,"org.eclipse.wst.jsdt.manipulation",1331428177880
+started,bundle,org.eclipse.wst.jsdt.core,1.1.102.v201111090634,"org.eclipse.wst.jsdt.core",1331428178148
+started,bundle,org.eclipse.wst.jsdt.ui,1.1.102.v201201131900,"org.eclipse.wst.jsdt.ui",1331428178279
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331428179147
+executed,command,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.edit.text.java.extract.method",1331428179259
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331428222254
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331428223199
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331428223897
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331428229505
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331428266995
+activated,view,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.DebugView",1331428271781
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331428275310
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331428277456
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331428358754
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331428366294
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331428545871
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331428576491
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331428736325
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331428753057
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461035690
+activated,view,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.PackageExplorer",1331461039383
+opened,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331461050055
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331461050119
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461057846
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461430248
+activated,view,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.PackageExplorer",1331461432107
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461438752
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461443663
+opened,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331461443922
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331461443989
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461447997
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461466849
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331461468280
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.cut",1331461473368
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331461474391
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.cut",1331461484439
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331461486317
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331461510548
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331461511438
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331461511597
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331461530776
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461532935
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461538526
+executed,command,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.edit.text.java.organize.imports",1331461538689
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461557225
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461562785
+executed,command,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.edit.text.java.create.getter.setter",1331461562898
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.cut",1331461568974
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331461571936
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331461576558
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331461579904
diff --git a/workspace/.metadata/.plugins/org.eclipse.epp.usagedata.recording/upload4.csv b/workspace/.metadata/.plugins/org.eclipse.epp.usagedata.recording/upload4.csv
new file mode 100644 (file)
index 0000000..e85de6d
--- /dev/null
@@ -0,0 +1,251 @@
+what,kind,bundleId,bundleVersion,description,time
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461622724
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461623804
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331461625849
+activated,view,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.PackageExplorer",1331461633320
+opened,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331461633664
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331461633728
+activated,view,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.PackageExplorer",1331461658031
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331461658947
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461660644
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461667027
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331461667410
+opened,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331461669928
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331461669997
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331461692384
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461702960
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461808648
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331461815925
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331462208697
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462212412
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331462224508
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331462232956
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462234273
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462236150
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.selectAll",1331462250037
+executed,command,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.edit.text.java.format",1331462252353
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331462255969
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462256931
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331462266473
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462267620
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331462273771
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331462275810
+executed,command,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.edit.text.java.organize.imports",1331462275957
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331462276655
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331462298643
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462299573
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331462314479
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331462349815
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462355202
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331462359459
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462360544
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331462363357
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331462375120
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331462421410
+activated,view,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.PackageExplorer",1331462425528
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331462425860
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331462435662
+activated,view,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.PackageExplorer",1331462444799
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331462445132
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331462450160
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331462452418
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462480852
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462484707
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331462511572
+executed,command,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.edit.text.java.organize.imports",1331462512785
+executed,command,org.eclipse.ui.ide,3.7.0.I20110519-0100,"org.eclipse.jdt.ui.edit.text.java.correction.assist.proposals",1331462517172
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331462538978
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331462553590
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331462594288
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462595994
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331462609472
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462610313
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462610458
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331462623413
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462626274
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462626401
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.undo",1331462627040
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331462651158
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462653498
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331462703871
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.cut",1331462737451
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462739250
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331462784337
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462789922
+executed,command,org.eclipse.ui.ide,3.7.0.I20110519-0100,"org.eclipse.jdt.ui.edit.text.java.correction.assist.proposals",1331462792023
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331462808022
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331462816231
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331462848555
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331462880654
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331462881882
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331462894626
+executed,command,,,"AUTOGEN:::org.eclipse.jdt.debug.CompilationUnitEditor.BreakpointRulerActions/org.eclipse.jdt.debug.ui.actions.ManageBreakpointRulerAction",1331462927278
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331462945798
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331462970770
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepInto",1331462974522
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331462975446
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331462975934
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331462978264
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331462979560
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331462980145
+opened,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331462980328
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331462980384
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331462980583
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331462982942
+opened,editor,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditor",1331462983147
+activated,editor,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditor",1331462983176
+closed,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331462983182
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.Resume",1331462984683
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331462999564
+closed,editor,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditor",1331462999564
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331463061338
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331463062608
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331463083252
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331463083840
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.paste",1331463084318
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331463085335
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331463090234
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463100930
+activated,view,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.DebugView",1331463127041
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463127076
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepInto",1331463129813
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463130684
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463131155
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463132675
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463133372
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463133948
+opened,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331463134148
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.Resume",1331463137004
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331463137225
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331463155718
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331463161042
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463168383
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463203595
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331463219507
+activated,view,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.PackageExplorer",1331463228850
+opened,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331463229159
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331463229220
+activated,view,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.PackageExplorer",1331463235690
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331463236211
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331463243274
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463253461
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463333494
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331463337209
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.edit.copy",1331463342174
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463343163
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463395189
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331463401197
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331463412345
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463433914
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463446942
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331463447107
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepInto",1331463448769
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463449496
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463449792
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331463450027
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463450141
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.Resume",1331463453713
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331463468137
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331463472177
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463482106
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463494922
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331463495255
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepInto",1331463496749
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463497557
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463498148
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463499786
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463500556
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463501156
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463501821
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463502221
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463502708
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463503229
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463503731
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463507628
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463509053
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.StepOver",1331463509813
+executed,command,,,"AUTOGEN:::org.eclipse.jdt.debug.CompilationUnitEditor.BreakpointRulerActions/org.eclipse.jdt.debug.ui.actions.ManageBreakpointRulerAction",1331463514656
+executed,command,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui.commands.Resume",1331463515538
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331463519997
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463598092
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463637104
+activated,editor,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui.CompilationUnitEditor",1331463651659
+executed,command,org.eclipse.ui,3.7.0.I20110602-0100,"org.eclipse.ui.file.save",1331463705359
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463711828
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463720894
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463723979
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463768917
+activated,view,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console.ConsoleView",1331463770297
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463786091
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463787834
+executed,command,com.google.appengine.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.appengine.eclipse.core.deployToGoogle",1331463789168
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331463820442
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331464019280
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331464027371
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331464959938
+deactivated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331464963429
+activated,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331464964907
+closed,workbench,org.eclipse.ui.workbench,3.7.0.I20110519-0100,"",1331464965247
+stopped,bundle,org.eclipse.m2e.logback.configuration,1.0.0.20110607-2117,"org.eclipse.m2e.logback.configuration",1331464966052
+stopped,bundle,org.eclipse.ui.cheatsheets,3.4.100.v20110425,"org.eclipse.ui.cheatsheets",1331464966052
+stopped,bundle,org.eclipse.help.ui,3.5.100.v20110425,"org.eclipse.help.ui",1331464966052
+stopped,bundle,org.eclipse.help.webapp,3.6.0.v20110518,"org.eclipse.help.webapp",1331464966052
+stopped,bundle,org.eclipse.epp.mpc.ui,1.1.0.I20110525-0742,"org.eclipse.epp.mpc.ui",1331464966053
+stopped,bundle,org.eclipse.epp.usagedata.ui,1.3.1.R201106061540,"org.eclipse.epp.usagedata.ui",1331464966053
+stopped,bundle,org.eclipse.ui.intro.universal,3.2.500.v20110510,"org.eclipse.ui.intro.universal",1331464966053
+stopped,bundle,org.eclipse.ui.intro,3.4.100.v20110425,"org.eclipse.ui.intro",1331464966053
+stopped,bundle,org.eclipse.help.base,3.6.0.v201106131736,"org.eclipse.help.base",1331464966053
+stopped,bundle,org.eclipse.equinox.http.jetty,2.0.100.v20110502,"org.eclipse.equinox.http.jetty",1331464966053
+stopped,bundle,com.google.appengine.eclipse.datatools,2.5.2.v201202290255-rel-r37,"com.google.appengine.eclipse.datatools",1331464966053
+stopped,bundle,com.google.appengine.eclipse.sdkbundle,1.6.3.v201202290255r37,"com.google.appengine.eclipse.sdkbundle",1331464966053
+stopped,bundle,com.google.gdt.eclipse.appengine.rpc,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.appengine.rpc",1331464966053
+stopped,bundle,com.google.gdt.eclipse.gph.e36,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.e36",1331464966053
+stopped,bundle,com.google.gdt.eclipse.gph.hge,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.hge",1331464966053
+stopped,bundle,com.google.gdt.eclipse.gph.subclipse,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.subclipse",1331464966054
+stopped,bundle,com.google.gdt.eclipse.gph.subversive,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.subversive",1331464966054
+stopped,bundle,com.google.gdt.eclipse.suite.ext,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.suite.ext",1331464966054
+stopped,bundle,com.google.gdt.eclipse.gph,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph",1331464966054
+stopped,bundle,com.google.gdt.eclipse.maven.e37,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.maven.e37",1331464966054
+stopped,bundle,com.google.gdt.eclipse.maven,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.maven",1331464966054
+stopped,bundle,com.google.gdt.eclipse.suite,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.suite",1331464966056
+stopped,bundle,com.google.gdt.eclipse.appsmarketplace,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.appsmarketplace",1331464966056
+stopped,bundle,com.google.appengine.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.appengine.eclipse.core",1331464966056
+stopped,bundle,com.google.gdt.eclipse.login,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.login",1331464966056
+stopped,bundle,com.google.gdt.eclipse.managedapis,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.managedapis",1331464966071
+stopped,bundle,com.google.gwt.eclipse.oophm,2.5.2.v201202290255-rel-r37,"com.google.gwt.eclipse.oophm",1331464966071
+stopped,bundle,com.google.gwt.eclipse.sdkbundle,2.4.0.v201202290255-rel-r37,"com.google.gwt.eclipse.sdkbundle",1331464966071
+stopped,bundle,com.google.gwt.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.gwt.eclipse.core",1331464966187
+stopped,bundle,com.google.gdt.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.core",1331464966188
+stopped,bundle,com.google.gdt.eclipse.platform,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform",1331464966188
+stopped,bundle,com.google.gdt.eclipse.platform.e37,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform.e37",1331464966188
+stopped,bundle,org.eclipse.m2e.discovery,1.0.200.20111228-1245,"org.eclipse.m2e.discovery",1331464966189
+stopped,bundle,org.eclipse.m2e.refactoring,1.0.200.20111228-1245,"org.eclipse.m2e.refactoring",1331464966189
+stopped,bundle,org.eclipse.m2e.editor,1.0.200.20111228-1245,"org.eclipse.m2e.editor",1331464966189
+stopped,bundle,org.eclipse.m2e.editor.xml,1.0.200.20111228-1245,"org.eclipse.m2e.editor.xml",1331464966189
+stopped,bundle,org.eclipse.m2e.jdt,1.0.200.20111228-1245,"org.eclipse.m2e.jdt",1331464966189
+stopped,bundle,org.eclipse.m2e.launching,1.0.200.20111228-1245,"org.eclipse.m2e.launching",1331464966190
+stopped,bundle,org.eclipse.m2e.usagedata,1.0.200.20111228-1245,"org.eclipse.m2e.usagedata",1331464966190
+stopped,bundle,org.eclipse.m2e.core.ui,1.0.200.20111228-1245,"org.eclipse.m2e.core.ui",1331464966190
+stopped,bundle,org.eclipse.m2e.core,1.0.200.20111228-1245,"org.eclipse.m2e.core",1331464966190
+stopped,bundle,org.eclipse.mylyn.ide.ant,3.6.0.v20110608-1400,"org.eclipse.mylyn.ide.ant",1331464966190
+stopped,bundle,org.eclipse.ant.ui,3.5.100.v20110510,"org.eclipse.ant.ui",1331464966190
+stopped,bundle,org.eclipse.ant.launching,1.0.100.v20110506,"org.eclipse.ant.launching",1331464966190
+stopped,bundle,org.eclipse.equinox.p2.ui.sdk,1.0.200.v20110502-1955,"org.eclipse.equinox.p2.ui.sdk",1331464966191
+stopped,bundle,org.eclipse.mylyn.java.tasks,3.6.0.v20110608-1400,"org.eclipse.mylyn.java.tasks",1331464966191
+stopped,bundle,org.eclipse.mylyn.java.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.java.ui",1331464966191
+stopped,bundle,com.google.gdt.eclipse.designer.UiBinder,2.5.0.r37x201112291029,"com.google.gdt.eclipse.designer.UiBinder",1331464966192
+stopped,bundle,com.google.gdt.eclipse.designer.gpe,2.5.0.r37x201201030222,"com.google.gdt.eclipse.designer.gpe",1331464966192
+stopped,bundle,com.google.gdt.eclipse.designer,2.5.0.r37x201112291029,"com.google.gdt.eclipse.designer",1331464966192
+stopped,bundle,org.eclipse.jdt.junit,3.7.0.v20110505-0800,"org.eclipse.jdt.junit",1331464966192
+stopped,bundle,org.eclipse.jdt.apt.ui,3.3.300.v20110305-1450,"org.eclipse.jdt.apt.ui",1331464966192
+stopped,bundle,org.eclipse.jdt.debug.ui,3.6.0.v20110512,"org.eclipse.jdt.debug.ui",1331464966194
+stopped,bundle,com.google.gdt.eclipse.platform.shared,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform.shared",1331464966194
+stopped,bundle,org.eclipse.wb.swing.FormLayout,1.0.0.r37x201106081552,"org.eclipse.wb.swing.FormLayout",1331464966195
+stopped,bundle,org.eclipse.wb.swing.MigLayout,1.0.0.r37x201106081552,"org.eclipse.wb.swing.MigLayout",1331464966195
+stopped,bundle,org.eclipse.wb.swing.databinding,1.0.0.r37x201106081552,"org.eclipse.wb.swing.databinding",1331464966195
+stopped,bundle,org.eclipse.wb.swing.java6,1.0.0.r37x201106081552,"org.eclipse.wb.swing.java6",1331464966195
+stopped,bundle,org.eclipse.wb.swing.jsr296,1.0.0.r37x201106081552,"org.eclipse.wb.swing.jsr296",1331464966195
+stopped,bundle,org.eclipse.wb.swing,1.0.0.r37x201106081552,"org.eclipse.wb.swing",1331464966195
+stopped,bundle,org.eclipse.wb.core.ui,1.0.0.r37x201106081733,"org.eclipse.wb.core.ui",1331464966195
+stopped,bundle,org.eclipse.wb.layout.group,1.0.0.r37x201106081642,"org.eclipse.wb.layout.group",1331464966195
+stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_0.webkit,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_0.webkit",1331464966195
index 0b58a89..18ea982 100644 (file)
 what,kind,bundleId,bundleVersion,description,time
-stopped,bundle,org.eclipse.ui.cheatsheets,3.4.100.v20110425,"org.eclipse.ui.cheatsheets",1331397104663
-stopped,bundle,org.eclipse.help.ui,3.5.100.v20110425,"org.eclipse.help.ui",1331397104663
-stopped,bundle,org.eclipse.help.webapp,3.6.0.v20110518,"org.eclipse.help.webapp",1331397104663
-stopped,bundle,org.eclipse.epp.mpc.ui,1.1.0.I20110525-0742,"org.eclipse.epp.mpc.ui",1331397104665
-stopped,bundle,org.eclipse.epp.usagedata.ui,1.3.1.R201106061540,"org.eclipse.epp.usagedata.ui",1331397104665
-stopped,bundle,org.eclipse.ui.intro.universal,3.2.500.v20110510,"org.eclipse.ui.intro.universal",1331397104665
-stopped,bundle,org.eclipse.ui.intro,3.4.100.v20110425,"org.eclipse.ui.intro",1331397104665
-stopped,bundle,org.eclipse.help.base,3.6.0.v201106131736,"org.eclipse.help.base",1331397104665
-stopped,bundle,org.eclipse.equinox.http.jetty,2.0.100.v20110502,"org.eclipse.equinox.http.jetty",1331397104665
-stopped,bundle,com.google.appengine.eclipse.datatools,2.5.2.v201202290255-rel-r37,"com.google.appengine.eclipse.datatools",1331397104666
-stopped,bundle,com.google.appengine.eclipse.sdkbundle,1.6.3.v201202290255r37,"com.google.appengine.eclipse.sdkbundle",1331397104666
-stopped,bundle,com.google.gdt.eclipse.appengine.rpc,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.appengine.rpc",1331397104666
-stopped,bundle,com.google.gdt.eclipse.gph.e36,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.e36",1331397104666
-stopped,bundle,com.google.gdt.eclipse.gph.hge,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.hge",1331397104666
-stopped,bundle,com.google.gdt.eclipse.gph.subclipse,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.subclipse",1331397104666
-stopped,bundle,com.google.gdt.eclipse.gph.subversive,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph.subversive",1331397104666
-stopped,bundle,com.google.gdt.eclipse.suite.ext,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.suite.ext",1331397104666
-stopped,bundle,com.google.gdt.eclipse.gph,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.gph",1331397104666
-stopped,bundle,com.google.gdt.eclipse.maven.e37,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.maven.e37",1331397104666
-stopped,bundle,com.google.gdt.eclipse.maven,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.maven",1331397104667
-stopped,bundle,com.google.gdt.eclipse.suite,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.suite",1331397104667
-stopped,bundle,com.google.gdt.eclipse.appsmarketplace,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.appsmarketplace",1331397104667
-stopped,bundle,com.google.appengine.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.appengine.eclipse.core",1331397104667
-stopped,bundle,com.google.gdt.eclipse.login,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.login",1331397104669
-stopped,bundle,com.google.gdt.eclipse.managedapis,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.managedapis",1331397104670
-stopped,bundle,com.google.gwt.eclipse.oophm,2.5.2.v201202290255-rel-r37,"com.google.gwt.eclipse.oophm",1331397104670
-stopped,bundle,com.google.gwt.eclipse.sdkbundle,2.4.0.v201202290255-rel-r37,"com.google.gwt.eclipse.sdkbundle",1331397104670
-stopped,bundle,com.google.gwt.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.gwt.eclipse.core",1331397104788
-stopped,bundle,com.google.gdt.eclipse.core,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.core",1331397104788
-stopped,bundle,com.google.gdt.eclipse.platform,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform",1331397104788
-stopped,bundle,com.google.gdt.eclipse.platform.e37,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform.e37",1331397104789
-stopped,bundle,org.eclipse.m2e.discovery,1.0.200.20111228-1245,"org.eclipse.m2e.discovery",1331397104789
-stopped,bundle,org.eclipse.m2e.refactoring,1.0.200.20111228-1245,"org.eclipse.m2e.refactoring",1331397104789
-stopped,bundle,org.eclipse.m2e.editor,1.0.200.20111228-1245,"org.eclipse.m2e.editor",1331397104790
-stopped,bundle,org.eclipse.m2e.editor.xml,1.0.200.20111228-1245,"org.eclipse.m2e.editor.xml",1331397104790
-stopped,bundle,org.eclipse.m2e.jdt,1.0.200.20111228-1245,"org.eclipse.m2e.jdt",1331397104790
-stopped,bundle,org.eclipse.m2e.launching,1.0.200.20111228-1245,"org.eclipse.m2e.launching",1331397104790
-stopped,bundle,org.eclipse.m2e.usagedata,1.0.200.20111228-1245,"org.eclipse.m2e.usagedata",1331397104790
-stopped,bundle,org.eclipse.m2e.core.ui,1.0.200.20111228-1245,"org.eclipse.m2e.core.ui",1331397104790
-stopped,bundle,org.eclipse.m2e.core,1.0.200.20111228-1245,"org.eclipse.m2e.core",1331397104790
-stopped,bundle,org.eclipse.mylyn.ide.ant,3.6.0.v20110608-1400,"org.eclipse.mylyn.ide.ant",1331397104790
-stopped,bundle,org.eclipse.ant.ui,3.5.100.v20110510,"org.eclipse.ant.ui",1331397104830
-stopped,bundle,org.eclipse.ant.launching,1.0.100.v20110506,"org.eclipse.ant.launching",1331397104830
-stopped,bundle,org.eclipse.equinox.p2.ui.sdk,1.0.200.v20110502-1955,"org.eclipse.equinox.p2.ui.sdk",1331397104830
-stopped,bundle,org.eclipse.mylyn.java.tasks,3.6.0.v20110608-1400,"org.eclipse.mylyn.java.tasks",1331397104830
-stopped,bundle,org.eclipse.mylyn.java.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.java.ui",1331397104831
-stopped,bundle,com.google.gdt.eclipse.designer.UiBinder,2.5.0.r37x201112291029,"com.google.gdt.eclipse.designer.UiBinder",1331397104831
-stopped,bundle,com.google.gdt.eclipse.designer.gpe,2.5.0.r37x201201030222,"com.google.gdt.eclipse.designer.gpe",1331397104831
-stopped,bundle,com.google.gdt.eclipse.designer,2.5.0.r37x201112291029,"com.google.gdt.eclipse.designer",1331397104832
-stopped,bundle,org.eclipse.jdt.junit,3.7.0.v20110505-0800,"org.eclipse.jdt.junit",1331397104832
-stopped,bundle,org.eclipse.jdt.apt.ui,3.3.300.v20110305-1450,"org.eclipse.jdt.apt.ui",1331397104832
-stopped,bundle,org.eclipse.jdt.debug.ui,3.6.0.v20110512,"org.eclipse.jdt.debug.ui",1331397104834
-stopped,bundle,com.google.gdt.eclipse.platform.shared,2.5.2.v201202290255-rel-r37,"com.google.gdt.eclipse.platform.shared",1331397104834
-stopped,bundle,org.eclipse.wb.swing.FormLayout,1.0.0.r37x201106081552,"org.eclipse.wb.swing.FormLayout",1331397104834
-stopped,bundle,org.eclipse.wb.swing.MigLayout,1.0.0.r37x201106081552,"org.eclipse.wb.swing.MigLayout",1331397104835
-stopped,bundle,org.eclipse.wb.swing.databinding,1.0.0.r37x201106081552,"org.eclipse.wb.swing.databinding",1331397104835
-stopped,bundle,org.eclipse.wb.swing.java6,1.0.0.r37x201106081552,"org.eclipse.wb.swing.java6",1331397104835
-stopped,bundle,org.eclipse.wb.swing.jsr296,1.0.0.r37x201106081552,"org.eclipse.wb.swing.jsr296",1331397104835
-stopped,bundle,org.eclipse.wb.swing,1.0.0.r37x201106081552,"org.eclipse.wb.swing",1331397104835
-stopped,bundle,org.eclipse.wb.core.ui,1.0.0.r37x201106081733,"org.eclipse.wb.core.ui",1331397104835
-stopped,bundle,org.eclipse.wb.layout.group,1.0.0.r37x201106081642,"org.eclipse.wb.layout.group",1331397104835
-stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_0.webkit,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_0.webkit",1331397104835
-stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_0,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_0",1331397104835
-stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_2.webkit,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_2.webkit",1331397104835
-stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_2,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_2",1331397104835
-stopped,bundle,com.google.gdt.eclipse.designer.hosted,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted",1331397104835
-stopped,bundle,org.eclipse.wb.core.databinding.xml,1.2.0.r37x201112291009,"org.eclipse.wb.core.databinding.xml",1331397104835
-stopped,bundle,org.eclipse.wb.core.databinding,1.2.0.r37x201112290923,"org.eclipse.wb.core.databinding",1331397104835
-stopped,bundle,org.eclipse.wb.core.xml,1.2.0.r37x201112291009,"org.eclipse.wb.core.xml",1331397104835
-stopped,bundle,org.eclipse.wb.css,1.2.0.r37x201112290951,"org.eclipse.wb.css",1331397104835
-stopped,bundle,org.eclipse.wb.os.macosx,1.2.0.r37x201112290923,"org.eclipse.wb.os.macosx",1331397104835
-stopped,bundle,org.eclipse.wb.core,1.2.0.r37x201112290923,"org.eclipse.wb.core",1331397104836
-stopped,bundle,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui",1331397104842
-stopped,bundle,org.eclipse.wst.dtd.ui,1.0.600.v201103171359,"org.eclipse.wst.dtd.ui",1331397104842
-stopped,bundle,org.eclipse.wst.xsd.ui,1.2.404.v201105050216,"org.eclipse.wst.xsd.ui",1331397104842
-stopped,bundle,org.eclipse.wst.css.ui,1.0.601.v201201101544,"org.eclipse.wst.css.ui",1331397104843
-stopped,bundle,org.eclipse.wst.xml.ui,1.1.202.v201112071516,"org.eclipse.wst.xml.ui",1331397104843
-stopped,bundle,org.eclipse.wst.common.ui,1.1.500.v200911190730,"org.eclipse.wst.common.ui",1331397104843
-stopped,bundle,org.eclipse.wst.jsdt.ui,1.1.102.v201201131900,"org.eclipse.wst.jsdt.ui",1331397104868
-stopped,bundle,org.eclipse.wst.sse.ui,1.3.2.v201201041522,"org.eclipse.wst.sse.ui",1331397104868
-stopped,bundle,org.eclipse.search,3.7.0.v20110505-0800,"org.eclipse.search",1331397104902
-stopped,bundle,org.eclipse.mylyn.commons.team,0.8.0.v20110608-1400,"org.eclipse.mylyn.commons.team",1331397104902
-stopped,bundle,org.eclipse.mylyn.team.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.team.ui",1331397104904
-stopped,bundle,org.eclipse.ui.navigator.resources,3.4.300.I20110421-1800,"org.eclipse.ui.navigator.resources",1331397104904
-stopped,bundle,org.eclipse.ltk.ui.refactoring,3.6.0.v20110505-0800,"org.eclipse.ltk.ui.refactoring",1331397104904
-stopped,bundle,org.eclipse.mylyn.bugzilla.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.bugzilla.ui",1331397104904
-stopped,bundle,org.eclipse.mylyn.ide.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.ide.ui",1331397104904
-stopped,bundle,org.eclipse.mylyn.resources.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.resources.ui",1331397104904
-stopped,bundle,org.eclipse.mylyn.wikitext.tasks.ui,1.5.0.v20110608-1400,"org.eclipse.mylyn.wikitext.tasks.ui",1331397104904
-stopped,bundle,org.eclipse.mylyn.context.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.context.ui",1331397104905
-stopped,bundle,org.eclipse.mylyn.help.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.help.ui",1331397104905
-stopped,bundle,org.eclipse.mylyn.tasks.bugs,3.6.0.v20110608-1400,"org.eclipse.mylyn.tasks.bugs",1331397104905
-stopped,bundle,org.eclipse.mylyn.tasks.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.tasks.ui",1331397104905
-stopped,bundle,org.eclipse.team.cvs.ui,3.3.400.I20110510-0800,"org.eclipse.team.cvs.ui",1331397104906
-stopped,bundle,org.eclipse.team.ui,3.6.100.I20110525-0800,"org.eclipse.team.ui",1331397104906
-stopped,bundle,org.eclipse.compare,3.5.200.I20110525-0800,"org.eclipse.compare",1331397104906
-stopped,bundle,org.eclipse.ui.externaltools,3.2.0.v20110506,"org.eclipse.ui.externaltools",1331397104906
-stopped,bundle,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui",1331397104908
-stopped,bundle,org.eclipse.mylyn.wikitext.ui,1.5.0.v20110608-1400,"org.eclipse.mylyn.wikitext.ui",1331397104908
-stopped,bundle,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console",1331397104909
+stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_0,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_0",1331464966195
+stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_2.webkit,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_2.webkit",1331464966195
+stopped,bundle,com.google.gdt.eclipse.designer.hosted.2_2,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted.2_2",1331464966195
+stopped,bundle,com.google.gdt.eclipse.designer.hosted,2.5.0.r37x201112291019,"com.google.gdt.eclipse.designer.hosted",1331464966195
+stopped,bundle,org.eclipse.wb.core.databinding.xml,1.2.0.r37x201112291009,"org.eclipse.wb.core.databinding.xml",1331464966195
+stopped,bundle,org.eclipse.wb.core.databinding,1.2.0.r37x201112290923,"org.eclipse.wb.core.databinding",1331464966195
+stopped,bundle,org.eclipse.wb.core.xml,1.2.0.r37x201112291009,"org.eclipse.wb.core.xml",1331464966195
+stopped,bundle,org.eclipse.wb.css,1.2.0.r37x201112290951,"org.eclipse.wb.css",1331464966195
+stopped,bundle,org.eclipse.wb.os.macosx,1.2.0.r37x201112290923,"org.eclipse.wb.os.macosx",1331464966196
+stopped,bundle,org.eclipse.wb.core,1.2.0.r37x201112290923,"org.eclipse.wb.core",1331464966196
+stopped,bundle,org.eclipse.jdt.ui,3.7.0.v20110531-1200,"org.eclipse.jdt.ui",1331464966202
+stopped,bundle,org.eclipse.wst.dtd.ui,1.0.600.v201103171359,"org.eclipse.wst.dtd.ui",1331464966202
+stopped,bundle,org.eclipse.wst.xsd.ui,1.2.404.v201105050216,"org.eclipse.wst.xsd.ui",1331464966202
+stopped,bundle,org.eclipse.wst.css.ui,1.0.601.v201201101544,"org.eclipse.wst.css.ui",1331464966202
+stopped,bundle,org.eclipse.wst.xml.ui,1.1.202.v201112071516,"org.eclipse.wst.xml.ui",1331464966203
+stopped,bundle,org.eclipse.wst.common.ui,1.1.500.v200911190730,"org.eclipse.wst.common.ui",1331464966203
+stopped,bundle,org.eclipse.wst.jsdt.ui,1.1.102.v201201131900,"org.eclipse.wst.jsdt.ui",1331464966247
+stopped,bundle,org.eclipse.wst.sse.ui,1.3.2.v201201041522,"org.eclipse.wst.sse.ui",1331464966247
+stopped,bundle,org.eclipse.search,3.7.0.v20110505-0800,"org.eclipse.search",1331464966273
+stopped,bundle,org.eclipse.mylyn.commons.team,0.8.0.v20110608-1400,"org.eclipse.mylyn.commons.team",1331464966273
+stopped,bundle,org.eclipse.mylyn.team.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.team.ui",1331464966273
+stopped,bundle,org.eclipse.ui.navigator.resources,3.4.300.I20110421-1800,"org.eclipse.ui.navigator.resources",1331464966273
+stopped,bundle,org.eclipse.ltk.ui.refactoring,3.6.0.v20110505-0800,"org.eclipse.ltk.ui.refactoring",1331464966274
+stopped,bundle,org.eclipse.mylyn.bugzilla.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.bugzilla.ui",1331464966274
+stopped,bundle,org.eclipse.mylyn.ide.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.ide.ui",1331464966274
+stopped,bundle,org.eclipse.mylyn.resources.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.resources.ui",1331464966274
+stopped,bundle,org.eclipse.mylyn.wikitext.tasks.ui,1.5.0.v20110608-1400,"org.eclipse.mylyn.wikitext.tasks.ui",1331464966274
+stopped,bundle,org.eclipse.mylyn.context.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.context.ui",1331464966274
+stopped,bundle,org.eclipse.mylyn.help.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.help.ui",1331464966274
+stopped,bundle,org.eclipse.mylyn.tasks.bugs,3.6.0.v20110608-1400,"org.eclipse.mylyn.tasks.bugs",1331464966274
+stopped,bundle,org.eclipse.mylyn.tasks.ui,3.6.0.v20110608-1400,"org.eclipse.mylyn.tasks.ui",1331464966275
+stopped,bundle,org.eclipse.team.cvs.ui,3.3.400.I20110510-0800,"org.eclipse.team.cvs.ui",1331464966277
+stopped,bundle,org.eclipse.team.ui,3.6.100.I20110525-0800,"org.eclipse.team.ui",1331464966277
+stopped,bundle,org.eclipse.compare,3.5.200.I20110525-0800,"org.eclipse.compare",1331464966277
+stopped,bundle,org.eclipse.ui.externaltools,3.2.0.v20110506,"org.eclipse.ui.externaltools",1331464966277
+stopped,bundle,org.eclipse.debug.ui,3.7.0.v20110518,"org.eclipse.debug.ui",1331464966279
+stopped,bundle,org.eclipse.mylyn.wikitext.ui,1.5.0.v20110608-1400,"org.eclipse.mylyn.wikitext.ui",1331464966279
+stopped,bundle,org.eclipse.ui.console,3.5.100.v20110511,"org.eclipse.ui.console",1331464966280
+stopped,bundle,org.eclipse.mylyn.commons.ui,3.6.1.v20110720-0100,"org.eclipse.mylyn.commons.ui",1331464966280
+stopped,bundle,org.eclipse.ui.editors,3.7.0.v20110517-0800,"org.eclipse.ui.editors",1331464966280
+stopped,bundle,org.eclipse.wst.common.snippets,1.2.100.v201103281740,"org.eclipse.wst.common.snippets",1331464966280
+stopped,bundle,org.eclipse.ui.workbench.texteditor,3.7.0.v20110505-0800,"org.eclipse.ui.workbench.texteditor",1331464966280
+stopped,bundle,org.eclipse.compare.core,3.5.200.I20110208-0800,"org.eclipse.compare.core",1331464966280
+stopped,bundle,org.eclipse.emf.edit.ui,2.7.0.v20110606-0949,"org.eclipse.emf.edit.ui",1331464966280
+stopped,bundle,org.eclipse.gef,3.7.0.v20110407-2050,"org.eclipse.gef",1331464966280
index 868e8b8..40255f3 100644 (file)
Binary files a/workspace/.metadata/.plugins/org.eclipse.jdt.core/471433581.index and b/workspace/.metadata/.plugins/org.eclipse.jdt.core/471433581.index differ
index 221ff6b..a716814 100644 (file)
@@ -1,45 +1,45 @@
 INDEX VERSION 1.126+/Users/yuji/prog/workspaces/TrainDelayBot/source/workspace/.metadata/.plugins/org.eclipse.jdt.core
-2570668310.index
-765977872.index
-1384487945.index
-3000285004.index
-121238776.index
-1438997932.index
-2487942853.index
-551190387.index
-1457489534.index
-84777399.index
-2265792888.index
-1702319727.index
-3302703152.index
-2765345590.index
 4249315662.index
-156905802.index
-4286473667.index
+2125629668.index
+1833648217.index
+3721599461.index
+3321539481.index
 2324327163.index
+393625461.index
+770573466.index
+1702319727.index
+3337990103.index
+121238776.index
+4238209716.index
+4286473667.index
+156905802.index
 3712507179.index
 272178059.index
-324969621.index
-3321539481.index
-1884285145.index
-393625461.index
 4210253391.index
-2545238116.index
+2487942853.index
+545044415.index
 3954040986.index
-471433581.index
-757901550.index
-2408811069.index
-3721599461.index
+2545238116.index
+3302703152.index
+84777399.index
 1819685514.index
-3337990103.index
+1884285145.index
+3000285004.index
+551190387.index
+757901550.index
+1457489534.index
+1384487945.index
+2265792888.index
+2765345590.index
+1438997932.index
+765977872.index
+324969621.index
 1271342938.index
-1833648217.index
-545044415.index
 450555687.index
+3266567714.index
+2326659272.index
 3004609673.index
+471433581.index
+2570668310.index
 3703194086.index
-770573466.index
-2326659272.index
-3266567714.index
-2125629668.index
-4238209716.index
+2408811069.index
index 26017a9..2f45a58 100644 (file)
@@ -2,7 +2,6 @@
 <qualifiedTypeNameHistroy>
 <fullyQualifiedTypeName name="twitter4j.QueryResult"/>
 <fullyQualifiedTypeName name="twitter4j.Query"/>
-<fullyQualifiedTypeName name="java.util.List"/>
 <fullyQualifiedTypeName name="twitter4j.conf.Configuration"/>
 <fullyQualifiedTypeName name="twitter4j.conf.ConfigurationBuilder"/>
 <fullyQualifiedTypeName name="com.yuji.tdb.common.CommonUtil"/>
 <fullyQualifiedTypeName name="java.util.Date"/>
 <fullyQualifiedTypeName name="java.util.ArrayList"/>
 <fullyQualifiedTypeName name="java.util.logging.Logger"/>
-<fullyQualifiedTypeName name="javax.jdo.annotations.IdentityType"/>
 <fullyQualifiedTypeName name="java.util.regex.Pattern"/>
 <fullyQualifiedTypeName name="java.util.regex.Matcher"/>
 <fullyQualifiedTypeName name="com.yuji.tdb.utility.StringUtil"/>
 <fullyQualifiedTypeName name="twitter4j.Status"/>
+<fullyQualifiedTypeName name="java.util.TimeZone"/>
+<fullyQualifiedTypeName name="javax.jdo.annotations.IdentityType"/>
+<fullyQualifiedTypeName name="java.util.List"/>
+<fullyQualifiedTypeName name="com.yuji.tdb.db.TrainDao"/>
 </qualifiedTypeNameHistroy>
index c0dfa28..8818426 100644 (file)
@@ -7,6 +7,21 @@
        <section name="OptionalMessageDialog.hide.">
                <item value="true" key="org.eclipse.jdt.ui.typecomment.deprecated"/>
        </section>
+       <section name="BuildPathsPropertyPage">
+               <item value="2" key="pageIndex"/>
+       </section>
+       <section name="RefactoringWizard.preview">
+               <item value="400" key="height"/>
+               <item value="600" key="width"/>
+       </section>
+       <section name="quick_assist_proposal_size">
+       </section>
+       <section name="SourceActionDialog.methods">
+               <item value="1" key="VisibilityModifier"/>
+               <item value="false" key="Comments"/>
+               <item value="false" key="SynchronizedModifier"/>
+               <item value="false" key="FinalModifier"/>
+       </section>
        <section name="org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart">
                <item value="true" key="group_libraries"/>
                <item value="false" key="linkWithEditor"/>
        </section>
        <section name="completion_proposal_size">
        </section>
-       <section name="JavaElementSearchActions">
+       <section name="ExtractMethodWizard">
+               <item value="false" key="ThrowRuntimeExceptions"/>
+               <item value="false" key="GenerateJavadoc"/>
+               <item value="2" key="AccessModifier"/>
        </section>
-       <section name="BuildPathsPropertyPage">
-               <item value="2" key="pageIndex"/>
+       <section name="JavaElementSearchActions">
        </section>
-       <section name="RefactoringWizard.preview">
-               <item value="400" key="height"/>
-               <item value="600" key="width"/>
+       <section name="RenameInformationPopup">
        </section>
        <section name="org.eclipse.ltk.ui.refactoring.settings">
                <item value="*" key="patterns"/>
                <item value="false" key="renameSubpackages"/>
                <item value="false" key="updateTextualMatches"/>
        </section>
-       <section name="quick_assist_proposal_size">
-       </section>
-       <section name="RenameInformationPopup">
-       </section>
-       <section name="SourceActionDialog.methods">
-               <item value="1" key="VisibilityModifier"/>
-               <item value="false" key="Comments"/>
-               <item value="false" key="SynchronizedModifier"/>
-               <item value="false" key="FinalModifier"/>
-       </section>
        <section name="org.eclipse.jdt.internal.ui.text.QuickOutline">
                <item value="false" key="GoIntoTopLevelTypeAction.isChecked"/>
                <item value="true" key="org.eclipse.jdt.internal.ui.text.JavaOutlineInformationControlDIALOG_USE_PERSISTED_SIZE"/>
diff --git a/workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/TrainDelayBot/2012/3/11/refactorings.history b/workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/TrainDelayBot/2012/3/11/refactorings.history
new file mode 100644 (file)
index 0000000..04d41c0
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<session version="1.0">&#x0A;<refactoring comment="Extract method &apos;private void twite(String text, Twitter twitter) throws TwitterException &apos; from &apos;com.yuji.tdb.twitter.TwitterUtil.main()&apos; to &apos;com.yuji.tdb.twitter.TwitterUtil&apos;&#x0A;- Original project: &apos;TrainDelayBot&apos;&#x0A;- Method name: &apos;twite&apos;&#x0A;- Destination type: &apos;com.yuji.tdb.twitter.TwitterUtil&apos;&#x0A;- Declared visibility: &apos;private&apos;" comments="false" description="Extract method &apos;twite&apos;" destination="0" exceptions="false" flags="786434" id="org.eclipse.jdt.ui.extract.method" input="/src&lt;com.yuji.tdb.twitter{TwitterUtil.java" name="twite" replace="false" selection="1663 1520" stamp="1331428178486" version="1.0" visibility="2"/>&#x0A;<refactoring comment="Copy element &apos;KeyValueDao.java&apos; to &apos;TrainDelayBot/src/com.yuji.tdb.db&apos;&#x0A;- Original project: &apos;TrainDelayBot&apos;&#x0A;- Destination element: &apos;TrainDelayBot/src/com.yuji.tdb.db&apos;&#x0A;- Original element: &apos;com.yuji.tdb.db.KeyValueDao.java&apos;" description="Copy compilation unit" destination="/src&lt;com.yuji.tdb.db" element1="/src&lt;com.yuji.tdb.db{KeyValueDao.java" files="0" flags="589830" folders="0" id="org.eclipse.jdt.ui.copy" policy="org.eclipse.jdt.ui.copyResources" stamp="1331461667300" units="1" version="1.0"/>
+</session>
\ No newline at end of file
diff --git a/workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/TrainDelayBot/2012/3/11/refactorings.index b/workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/TrainDelayBot/2012/3/11/refactorings.index
new file mode 100644 (file)
index 0000000..631005d
--- /dev/null
@@ -0,0 +1,2 @@
+1331428178486  Extract method 'twite'
+1331461667300  Copy compilation unit
index 5aeb78f..a214979 100644 (file)
@@ -12,3 +12,5 @@
 2012-03-08 00:24:26,440 [org.eclipse.jdt.internal.ui.text.JavaReconciler] INFO  org.mortbay.log - Logging to Logger[org.mortbay.log] via org.mortbay.log.Slf4jLog
 2012-03-08 01:03:07,339 [org.eclipse.jdt.internal.ui.text.JavaReconciler] INFO  org.mortbay.log - Logging to Logger[org.mortbay.log] via org.mortbay.log.Slf4jLog
 2012-03-11 00:50:50,092 [org.eclipse.jdt.internal.ui.text.JavaReconciler] INFO  org.mortbay.log - Logging to Logger[org.mortbay.log] via org.mortbay.log.Slf4jLog
+2012-03-11 02:09:03,359 [org.eclipse.jdt.internal.ui.text.JavaReconciler] INFO  org.mortbay.log - Logging to Logger[org.mortbay.log] via org.mortbay.log.Slf4jLog
+2012-03-11 09:07:32,089 [org.eclipse.jdt.internal.ui.text.JavaReconciler] INFO  org.mortbay.log - Logging to Logger[org.mortbay.log] via org.mortbay.log.Slf4jLog
index ff5f894..4bd534f 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<workbench progressCount="48" version="2.0">
+<workbench progressCount="43" version="2.0">
 <workbenchAdvisor/>
 <window height="783" width="1241" x="73" y="26">
 <fastViewData fastViewLocation="1024"/>
 <part id="0"/>
 <part id="1"/>
 <part id="2"/>
+<part id="3"/>
+<part id="4"/>
+<part id="5"/>
+<part id="6"/>
+<part id="7"/>
+<part id="8"/>
 </presentation>
 </folder>
 </info>
 </editorArea>
-<editor id="org.eclipse.jdt.ui.CompilationUnitEditor" name="TwitterUtil.java" partName="TwitterUtil.java" path="/Users/yuji/prog/workspaces/TrainDelayBot/source/workspace/TrainDelayBot/src/com/yuji/tdb/twitter/TwitterUtil.java" title="TwitterUtil.java" tooltip="TrainDelayBot/src/com/yuji/tdb/twitter/TwitterUtil.java" workbook="DefaultEditorWorkbook">
+<editor activePart="true" focus="true" id="org.eclipse.jdt.ui.CompilationUnitEditor" name="TwitterUtil.java" partName="TwitterUtil.java" path="/Users/yuji/prog/workspaces/TrainDelayBot/source/workspace/TrainDelayBot/src/com/yuji/tdb/twitter/TwitterUtil.java" title="TwitterUtil.java" tooltip="TrainDelayBot/src/com/yuji/tdb/twitter/TwitterUtil.java" workbook="DefaultEditorWorkbook">
 <input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TrainDelayBot/src/com/yuji/tdb/twitter/TwitterUtil.java"/>
-<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="2783" selectionTopPixel="0"/>
+<editorState selectionHorizontalPixel="7" selectionLength="0" selectionOffset="3153" selectionTopPixel="2165"/>
 </editor>
 <editor id="org.eclipse.jdt.ui.CompilationUnitEditor" name="StringUtility.java" partName="StringUtility.java" path="/Users/yuji/prog/workspaces/TrainDelayBot/source/workspace/TrainDelayBot/src/com/yuji/tdb/utility/StringUtility.java" title="StringUtility.java" tooltip="TrainDelayBot/src/com/yuji/tdb/utility/StringUtility.java" workbook="DefaultEditorWorkbook">
 <input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TrainDelayBot/src/com/yuji/tdb/utility/StringUtility.java"/>
-<editorState selectionHorizontalPixel="0" selectionLength="13" selectionOffset="77" selectionTopPixel="0"/>
+<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="1001" selectionTopPixel="298"/>
 </editor>
-<editor activePart="true" focus="true" id="org.eclipse.jdt.ui.CompilationUnitEditor" name="Main.java" partName="Main.java" path="/Users/yuji/prog/workspaces/TrainDelayBot/source/workspace/TrainDelayBot/src/com/yuji/tdb/main/Main.java" title="Main.java" tooltip="TrainDelayBot/src/com/yuji/tdb/main/Main.java" workbook="DefaultEditorWorkbook">
+<editor id="org.eclipse.jdt.ui.CompilationUnitEditor" name="Main.java" partName="Main.java" path="/Users/yuji/prog/workspaces/TrainDelayBot/source/workspace/TrainDelayBot/src/com/yuji/tdb/main/Main.java" title="Main.java" tooltip="TrainDelayBot/src/com/yuji/tdb/main/Main.java" workbook="DefaultEditorWorkbook">
 <input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TrainDelayBot/src/com/yuji/tdb/main/Main.java"/>
-<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="282" selectionTopPixel="36"/>
+<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="442" selectionTopPixel="61"/>
+</editor>
+<editor id="org.eclipse.jdt.ui.CompilationUnitEditor" name="KeyValue.java" partName="KeyValue.java" path="/Users/yuji/prog/workspaces/TrainDelayBot/source/workspace/TrainDelayBot/src/com/yuji/tdb/db/KeyValue.java" title="KeyValue.java" tooltip="TrainDelayBot/src/com/yuji/tdb/db/KeyValue.java" workbook="DefaultEditorWorkbook">
+<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TrainDelayBot/src/com/yuji/tdb/db/KeyValue.java"/>
+<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="0" selectionTopPixel="0"/>
+</editor>
+<editor id="org.eclipse.jdt.ui.CompilationUnitEditor" name="Train.java" partName="Train.java" path="/Users/yuji/prog/workspaces/TrainDelayBot/source/workspace/TrainDelayBot/src/com/yuji/tdb/db/Train.java" title="Train.java" tooltip="TrainDelayBot/src/com/yuji/tdb/db/Train.java" workbook="DefaultEditorWorkbook">
+<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TrainDelayBot/src/com/yuji/tdb/db/Train.java"/>
+<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="618" selectionTopPixel="278"/>
+</editor>
+<editor id="org.eclipse.jdt.ui.CompilationUnitEditor" name="KeyValueDao.java" partName="KeyValueDao.java" path="/Users/yuji/prog/workspaces/TrainDelayBot/source/workspace/TrainDelayBot/src/com/yuji/tdb/db/KeyValueDao.java" title="KeyValueDao.java" tooltip="TrainDelayBot/src/com/yuji/tdb/db/KeyValueDao.java" workbook="DefaultEditorWorkbook">
+<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TrainDelayBot/src/com/yuji/tdb/db/KeyValueDao.java"/>
+<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="0" selectionTopPixel="62"/>
+</editor>
+<editor id="org.eclipse.jdt.ui.CompilationUnitEditor" name="TrainDao.java" partName="TrainDao.java" path="/Users/yuji/prog/workspaces/TrainDelayBot/source/workspace/TrainDelayBot/src/com/yuji/tdb/db/TrainDao.java" title="TrainDao.java" tooltip="TrainDelayBot/src/com/yuji/tdb/db/TrainDao.java" workbook="DefaultEditorWorkbook">
+<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TrainDelayBot/src/com/yuji/tdb/db/TrainDao.java"/>
+<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="556" selectionTopPixel="58"/>
+</editor>
+<editor id="org.eclipse.jdt.ui.CompilationUnitEditor" name="TrainDelayBotServlet.java" partName="TrainDelayBotServlet.java" path="/Users/yuji/prog/workspaces/TrainDelayBot/source/workspace/TrainDelayBot/src/com/yuji/tdb/TrainDelayBotServlet.java" title="TrainDelayBotServlet.java" tooltip="TrainDelayBot/src/com/yuji/tdb/TrainDelayBotServlet.java" workbook="DefaultEditorWorkbook">
+<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TrainDelayBot/src/com/yuji/tdb/TrainDelayBotServlet.java"/>
+<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="3020" selectionTopPixel="1170"/>
+</editor>
+<editor id="org.eclipse.jdt.ui.CompilationUnitEditor" name="PMFactory.java" partName="PMFactory.java" path="/Users/yuji/prog/workspaces/TrainDelayBot/source/workspace/TrainDelayBot/src/com/yuji/tdb/db/PMFactory.java" title="PMFactory.java" tooltip="TrainDelayBot/src/com/yuji/tdb/db/PMFactory.java" workbook="DefaultEditorWorkbook">
+<input factoryID="org.eclipse.ui.part.FileEditorInputFactory" path="/TrainDelayBot/src/com/yuji/tdb/db/PMFactory.java"/>
+<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="0" selectionTopPixel="0"/>
 </editor>
 </editors>
 <views>
-<view id="org.eclipse.ui.views.ProgressView" partName="Progress">
-<viewState/>
-</view>
 <view id="org.eclipse.jdt.ui.TypeHierarchy" partName="Type Hierarchy">
 <viewState hidefields="false" hidelocaltypes="false" hidenonpublic="false" hidestatic="false" input="=TrainDelayBot/src&lt;com.yuji.tdb.utility{StringUtil.java[StringUtil" link_editors="0" mv_vertical_scroll="0" orientation="3" qualified_names="0" ratio="350" selection="=TrainDelayBot/src&lt;com.yuji.tdb.utility{StringUtil.java[StringUtil" showinherited="false" sortbydefiningtype="false" vertical_scroll="0" view="2" workingSetName=""/>
 </view>
+<view id="org.eclipse.ui.views.ProgressView" partName="Progress">
+<viewState/>
+</view>
 <view id="org.eclipse.debug.ui.DebugView" partName="Debug">
 <viewState/>
 </view>
 <view id="org.eclipse.ui.views.ProblemView" partName="Problems">
 <viewState PRIMARY_SORT_FIELD="org.eclipse.ui.ide.severityAndDescriptionField" categoryGroup="org.eclipse.ui.ide.severity" markerContentGenerator="org.eclipse.ui.ide.problemsGenerator" partName="Problems">
 <expanded>
-<category IMemento.internal.id="Warnings (4 items)"/>
+<category IMemento.internal.id="Warnings (2 items)"/>
 </expanded>
 <columnWidths org.eclipse.ui.ide.locationField="180" org.eclipse.ui.ide.markerType="180" org.eclipse.ui.ide.pathField="240" org.eclipse.ui.ide.resourceField="180" org.eclipse.ui.ide.severityAndDescriptionField="600"/>
 <visible IMemento.internal.id="org.eclipse.ui.ide.severityAndDescriptionField"/>
 <viewState/>
 </view>
 </views>
-<perspectives activePart="org.eclipse.jdt.ui.CompilationUnitEditor" activePerspective="org.eclipse.jdt.ui.JavaPerspective">
+<perspectives activePart="org.eclipse.ui.console.ConsoleView" activePerspective="org.eclipse.jdt.ui.JavaPerspective">
 <perspective editorAreaTrimState="2" editorAreaVisible="1" fixed="0" version="0.016">
 <descriptor class="org.eclipse.jdt.internal.ui.JavaPerspectiveFactory" id="org.eclipse.jdt.ui.JavaPerspective" label="Java"/>
 <alwaysOnActionSet id="org.eclipse.mylyn.context.ui.actionSet"/>
 <workingSets/>
 <navigationHistory>
 <editors>
-<editor factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" path="/TrainDelayBot/src/com/yuji/tdb/utility/StringUtil.java"/>
-<editor factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" path="/TrainDelayBot/src/com/yuji/tdb/main/Main.java"/>
 <editor factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" path="/TrainDelayBot/src/com/yuji/tdb/twitter/TwitterUtil.java"/>
-<editor factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" path="/TrainDelayBot/src/com/yuji/tdb/utility/StringUtility.java"/>
+<editor factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" path="/TrainDelayBot/src/com/yuji/tdb/db/TrainDao.java"/>
+<editor factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" path="/TrainDelayBot/src/com/yuji/tdb/TrainDelayBotServlet.java"/>
+<editor factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" path="/TrainDelayBot/src/com/yuji/tdb/db/PMFactory.java"/>
 </editors>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="454" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="499" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="539" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="1766" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="352" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="1613" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="454" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="1671" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="499" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3654" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="603" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3696" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="648" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3732" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="670" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3780" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="684" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3843" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="352" y="0"/>
+<item historyLabel="TrainDelayBotServlet.java" index="2">
+<position info="not_deleted" x="2999" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="847" y="0"/>
+<item historyLabel="TrainDelayBotServlet.java" index="2">
+<position info="not_deleted" x="3020" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="352" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3843" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="454" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3839" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="499" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3965" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="539" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="1671" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="561" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3654" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="575" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3696" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="352" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3732" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="454" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3780" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="499" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3823" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="539" y="0"/>
+<item historyLabel="TrainDelayBotServlet.java" index="2">
+<position info="not_deleted" x="2999" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="352" y="0"/>
+<item historyLabel="TrainDao.java" index="1">
+<position info="not_deleted" x="107" y="8"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="454" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3823" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="499" y="0"/>
+<item historyLabel="TrainDao.java" index="1">
+<position info="not_deleted" x="107" y="8"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="603" y="0"/>
+<item historyLabel="PMFactory.java" index="3">
+<position info="not_deleted" x="0" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="648" y="0"/>
+<item historyLabel="TrainDao.java" index="1">
+<position info="not_deleted" x="107" y="8"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="670" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3823" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="684" y="0"/>
+<item historyLabel="TrainDao.java" index="1">
+<position info="not_deleted" x="556" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="352" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="1671" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="448" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3654" y="0"/>
 </item>
-<item historyLabel="Main.java" index="1">
-<position info="not_deleted" x="419" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3696" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="726" y="29"/>
+<item historyLabel="TrainDelayBotServlet.java" index="2">
+<position info="not_deleted" x="2999" y="0"/>
 </item>
-<item historyLabel="Main.java" index="1">
-<position info="not_deleted" x="419" y="0"/>
+<item historyLabel="TrainDelayBotServlet.java" index="2">
+<position info="not_deleted" x="3020" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="726" y="29"/>
+<item historyLabel="TrainDao.java" index="1">
+<position info="not_deleted" x="556" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="846" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="1671" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="846" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3654" y="0"/>
 </item>
-<item historyLabel="Main.java" index="1">
-<position info="not_deleted" x="419" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3696" y="0"/>
 </item>
-<item historyLabel="TwitterUtil.java" index="2">
-<position info="not_deleted" x="2779" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3732" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="247" y="14"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3780" y="0"/>
 </item>
-<item historyLabel="TwitterUtil.java" index="2">
-<position info="not_deleted" x="2779" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3823" y="0"/>
 </item>
-<item historyLabel="TwitterUtil.java" index="2">
-<position info="not_deleted" x="2742" y="10"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3843" y="0"/>
 </item>
-<item historyLabel="TwitterUtil.java" index="2">
-<position info="not_deleted" x="2777" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3884" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position info="not_deleted" x="247" y="14"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3904" y="0"/>
 </item>
-<item historyLabel="StringUtil.java" index="0">
-<position/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3945" y="0"/>
 </item>
-<item historyLabel="StringUtility.java" index="3">
-<position info="not_deleted" x="77" y="13"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3965" y="0"/>
 </item>
-<item historyLabel="Main.java" index="1">
-<position info="not_deleted" x="419" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="3995" y="0"/>
 </item>
-<item historyLabel="Main.java" index="1">
-<position info="not_deleted" x="282" y="0"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="1671" y="0"/>
 </item>
-<item historyLabel="Main.java" index="1">
-<position info="not_deleted" x="1077" y="6"/>
+<item historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="1710" y="0"/>
 </item>
-<item active="true" historyLabel="Main.java" index="1">
-<position info="not_deleted" x="282" y="0"/>
+<item active="true" historyLabel="TwitterUtil.java" index="0">
+<position info="not_deleted" x="1740" y="0"/>
 </item>
 </navigationHistory>
 <input factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/" type="8"/>
 </trimLayout>
 </window>
 <mruList>
+<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" name="PMFactory.java" tooltip="TrainDelayBot/src/com/yuji/tdb/db/PMFactory.java">
+<persistable path="/TrainDelayBot/src/com/yuji/tdb/db/PMFactory.java"/>
+</file>
+<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" name="TrainDelayBotServlet.java" tooltip="TrainDelayBot/src/com/yuji/tdb/TrainDelayBotServlet.java">
+<persistable path="/TrainDelayBot/src/com/yuji/tdb/TrainDelayBotServlet.java"/>
+</file>
+<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" name="TrainDao.java" tooltip="TrainDelayBot/src/com/yuji/tdb/db/TrainDao.java">
+<persistable path="/TrainDelayBot/src/com/yuji/tdb/db/TrainDao.java"/>
+</file>
+<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" name="KeyValueDao.java" tooltip="TrainDelayBot/src/com/yuji/tdb/db/KeyValueDao.java">
+<persistable path="/TrainDelayBot/src/com/yuji/tdb/db/KeyValueDao.java"/>
+</file>
+<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" name="Train.java" tooltip="TrainDelayBot/src/com/yuji/tdb/db/Train.java">
+<persistable path="/TrainDelayBot/src/com/yuji/tdb/db/Train.java"/>
+</file>
+<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" name="KeyValue.java" tooltip="TrainDelayBot/src/com/yuji/tdb/db/KeyValue.java">
+<persistable path="/TrainDelayBot/src/com/yuji/tdb/db/KeyValue.java"/>
+</file>
 <file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" name="Main.java" tooltip="TrainDelayBot/src/com/yuji/tdb/main/Main.java">
 <persistable path="/TrainDelayBot/src/com/yuji/tdb/main/Main.java"/>
 </file>
 <file factoryID="org.eclipse.jdt.ui.ClassFileEditorInputFactory" id="org.eclipse.jdt.ui.ClassFileEditor" name="RequestToken.class" tooltip="twitter4j.auth.RequestToken">
 <persistable org.eclipse.jdt.ui.ClassFileIdentifier="=TrainDelayBot/war\/WEB-INF\/lib\/twitter4j-core-2.2.5.jar&lt;twitter4j.auth(RequestToken.class"/>
 </file>
-<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" name="KeyValueDao.java" tooltip="TrainDelayBot/src/com/yuji/tdb/db/KeyValueDao.java">
-<persistable path="/TrainDelayBot/src/com/yuji/tdb/db/KeyValueDao.java"/>
-</file>
-<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" name="KeyValue.java" tooltip="TrainDelayBot/src/com/yuji/tdb/db/KeyValue.java">
-<persistable path="/TrainDelayBot/src/com/yuji/tdb/db/KeyValue.java"/>
-</file>
-<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" name="PMFactory.java" tooltip="TrainDelayBot/src/com/yuji/tdb/db/PMFactory.java">
-<persistable path="/TrainDelayBot/src/com/yuji/tdb/db/PMFactory.java"/>
-</file>
 <file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.PropertiesFileEditor" name="logging.properties" tooltip="TrainDelayBot/war/WEB-INF/logging.properties">
 <persistable path="/TrainDelayBot/war/WEB-INF/logging.properties"/>
 </file>
 <file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" name="CommonUtil.java" tooltip="TrainDelayBot/src/com/yuji/tdb/util/CommonUtil.java">
 <persistable path="/TrainDelayBot/src/com/yuji/tdb/util/CommonUtil.java"/>
 </file>
-<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart" name="appengine-web.xml" tooltip="TrainDelayBot/war/WEB-INF/appengine-web.xml">
-<persistable path="/TrainDelayBot/war/WEB-INF/appengine-web.xml"/>
-</file>
-<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart" name="cron.xml" tooltip="TrainDelayBot/war/WEB-INF/cron.xml">
-<persistable path="/TrainDelayBot/war/WEB-INF/cron.xml"/>
-</file>
-<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.eclipse.jdt.ui.CompilationUnitEditor" name="TrainDelayBotServlet.java" tooltip="TrainDelayBot/src/com/yuji/tdb/TrainDelayBotServlet.java">
-<persistable path="/TrainDelayBot/src/com/yuji/tdb/TrainDelayBotServlet.java"/>
-</file>
 </mruList>
 </workbench>
\ No newline at end of file
diff --git a/workspace/TrainDelayBot/src/com/yuji/tdb/db/Train.java b/workspace/TrainDelayBot/src/com/yuji/tdb/db/Train.java
new file mode 100644 (file)
index 0000000..a82519d
--- /dev/null
@@ -0,0 +1,39 @@
+package com.yuji.tdb.db;
+
+import javax.jdo.annotations.IdGeneratorStrategy;
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.PersistenceCapable;
+import javax.jdo.annotations.Persistent;
+import javax.jdo.annotations.PrimaryKey;
+
+@PersistenceCapable(identityType = IdentityType.APPLICATION)
+public class Train {
+    @PrimaryKey
+    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
+    private Long id;
+    @Persistent
+    private String name;
+       @Persistent
+    private String searchWord;
+    @Persistent
+    private int count;
+
+    public Train(String name, String searchWord, int count){
+       this.name = name;
+       this.searchWord = searchWord;
+       this.count = count;
+    }
+    
+    public Long getId() {
+               return id;
+       }
+       public String getName() {
+               return name;
+       }
+       public String getSearchWord() {
+               return searchWord;
+       }
+       public int getCount() {
+               return count;
+       }
+}
diff --git a/workspace/TrainDelayBot/src/com/yuji/tdb/db/TrainDao.java b/workspace/TrainDelayBot/src/com/yuji/tdb/db/TrainDao.java
new file mode 100644 (file)
index 0000000..6a5533d
--- /dev/null
@@ -0,0 +1,31 @@
+package com.yuji.tdb.db;\r
+\r
+import java.util.List;\r
+\r
+import javax.jdo.PersistenceManager;\r
+\r
+public class TrainDao {\r
+       private static TrainDao instance = null;\r
+       private PersistenceManager pm = PMFactory.get().getPersistenceManager();\r
+\r
+       public static TrainDao getInstance() {\r
+               if (instance == null) {\r
+                       instance = new TrainDao();\r
+               }\r
+               return instance;\r
+       }\r
+\r
+       private TrainDao() {\r
+\r
+       }\r
+\r
+       public List<Train> search() {\r
+               String query = "SELECT FROM " + Train.class.getName();\r
+               List<Train> list = (List<Train>) pm.newQuery(query).execute();\r
+               return list;\r
+       }\r
+\r
+       public void put(Train train) {\r
+               pm.makePersistent(train);\r
+       }\r
+}\r
index b64b11f..e490f2a 100644 (file)
@@ -16,8 +16,8 @@ public class Main {
        }\r
        \r
        public static void test1(){\r
-               String text = "\82 \82¢\82¤\82¦\82¨";\r
-               int length = 3;\r
+               String text = "\82 \82¢ bb cc";\r
+               int length = 1;\r
                String ret = StringUtility.parseSubstring(text, length);\r
                System.out.println(ret);\r
        }\r
index e44cdbf..9ea526e 100644 (file)
@@ -1,5 +1,7 @@
 package com.yuji.tdb.twitter;\r
 \r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
 import java.util.ArrayList;\r
 import java.util.Calendar;\r
 import java.util.Date;\r
@@ -17,6 +19,8 @@ import twitter4j.auth.AccessToken;
 import twitter4j.conf.ConfigurationBuilder;\r
 \r
 import com.yuji.tdb.common.CommonUtil;\r
+import com.yuji.tdb.db.Train;\r
+import com.yuji.tdb.db.TrainDao;\r
 import com.yuji.tdb.utility.StringUtility;\r
 \r
 public class TwitterUtil {\r
@@ -24,6 +28,7 @@ public class TwitterUtil {
                        .getLogger(TwitterUtil.class.getName());\r
        private static TwitterUtil instance = null;\r
        private static Object obj = new Object();\r
+       private DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");\r
 \r
        public static TwitterUtil getInstance() {\r
                if (instance == null) {\r
@@ -37,13 +42,10 @@ public class TwitterUtil {
        }\r
 \r
        private TwitterUtil() {\r
-\r
+               //TimeZone.setDefault(TimeZone.getTimeZone("JST")); // TODO \8fê\8f\8a\r
        }\r
 \r
        public void main(String consumerKey, String consumerSecret, AccessToken accessToken) {\r
-\r
-               String text = "\8b\9e\95l\93\8c\96k";\r
-\r
                try {\r
                        ConfigurationBuilder confBuilder = new ConfigurationBuilder();\r
                        confBuilder.setDebugEnabled(true).setOAuthConsumerKey(consumerKey)\r
@@ -51,69 +53,96 @@ public class TwitterUtil {
                        TwitterFactory factory = new TwitterFactory(confBuilder.build());\r
                        Twitter twitter = factory.getInstance(accessToken);\r
 \r
-                       Calendar cal = Calendar.getInstance();\r
-                       Date date = cal.getTime();\r
-                       long cur = date.getTime();\r
+                       List<Train> list = getTrainList();\r
+                       for (Train train : list){\r
+                               twite(twitter, train);\r
+                       }\r
+               } catch (TwitterException e) {\r
+                       // TODO Auto-generated catch block\r
+                       e.printStackTrace();\r
+                       log.severe(e.toString());\r
+               }\r
+       }\r
+\r
+       private void twite(Twitter twitter, Train train) throws TwitterException {\r
+               Calendar cal = Calendar.getInstance();\r
+               Date date = cal.getTime();\r
+               long cur = date.getTime();\r
+               \r
+               Query query = new Query();\r
+               //query.setRpp(1000); // TODO\r
+               query.setQuery(train.getSearchWord());\r
+               QueryResult result = twitter.search(query);\r
+               List<Tweet> tweets = result.getTweets();\r
+               \r
+               int count = 0;\r
+               int hit = 0;\r
+               int mhit = 0;\r
+               \r
+               int index;\r
+               int mindex = 0;\r
+               int size = tweets.size();\r
+               for (index = 0; index < size; index++) {\r
+                       Tweet tweet = tweets.get(index);\r
                        \r
-                       Query query = new Query();\r
-                       //query.setRpp(1000); // TODO\r
-                       query.setQuery(text);\r
-                       QueryResult result = twitter.search(query);\r
-                       List<Tweet> tweets = result.getTweets();\r
+                       Date at = tweet.getCreatedAt();\r
+                       long t = at.getTime();\r
                        \r
-                       int count = 0;\r
-                       int hit = 0;\r
-                       int mhit = 0;\r
+                       String message = tweet.getText();\r
                        \r
-                       int index;\r
-                       int mindex = 0;\r
-                       int size = tweets.size();\r
-                       for (index = 0; index < size; index++) {\r
-                               Tweet tweet = tweets.get(index);\r
-                               \r
-                               Date at = tweet.getCreatedAt();\r
-                               long t = at.getTime();\r
-                               \r
-                               String message = tweet.getText();\r
-                               \r
-                               if (t < cur - 30 * 60 * 1000){\r
-                                       System.out.println("\81~" + tweet.getFromUser() + " - "\r
-                                                       + tweet.getText() + at);\r
-                                       continue;\r
-                               }\r
-                               hit = filter(message);\r
-                               if (hit <= 0) {\r
-                                       // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
-                                       continue;\r
-                               }\r
-                               if (hit > mhit){\r
-                                       hit = mhit;\r
-                                       mindex = index;\r
-                               }\r
-\r
-                               System.out.println("@" + tweet.getFromUser() + " - "\r
+                       if (t < cur - 30 * 60 * 1000){\r
+                               System.out.println("\81~" + tweet.getFromUser() + " - "\r
                                                + tweet.getText() + at);\r
-                               count++;\r
+                               continue;\r
                        }\r
-               \r
-                       String message = "";\r
-                       if (count < 10){\r
-                               message = "\92x\89\84\82È\82µ " + date.toString();                        \r
+                       hit = filter(message);\r
+                       if (hit <= 0) {\r
+                               System.out.println("\81¢" + tweet.getFromUser() + " - "\r
+                                               + tweet.getText() + at);\r
+                               // \92x\89\84\88È\8aO\82Ì\8f\91\82«\8d\9e\82Ý\r
+                               continue;\r
                        }\r
-                       else {\r
-                               int N = 100;\r
-                               \r
-                               String sample = tweets.get(mindex).getText();\r
-                               sample = CommonUtil.replaceString(sample, "@", "(a)");\r
-                               sample = StringUtility.parseSubstring(sample, N);\r
-                               message = sample + " " + date.toString() + " count=" + count;                                                   \r
+                       if (hit > mhit){\r
+                               hit = mhit;\r
+                               mindex = index;\r
                        }\r
-                       Status status = twitter.updateStatus(message);\r
-               } catch (TwitterException e) {\r
-                       // TODO Auto-generated catch block\r
-                       e.printStackTrace();\r
-                       log.severe(e.toString());\r
+\r
+                       System.out.println("@" + tweet.getFromUser() + " - "\r
+                                       + tweet.getText() + at);\r
+                       count++;\r
+               }\r
+\r
+               String message = "[" + train.getName() + "] ";\r
+               if (count < train.getCount()){\r
+                       message += "\92x\89\84\82È\82µ " + df.format(date);       \r
+               }\r
+               else {\r
+                       int N = 100;\r
+                       \r
+                       String sample = tweets.get(mindex).getText();\r
+                       sample = CommonUtil.replaceString(sample, "@", "(a)");\r
+                       sample = StringUtility.parseSubstring(sample, N);\r
+                       message += sample + " " + df.format(date) + " count=" + count;                                                  \r
+               }\r
+               System.out.println(message); //TODO\r
+               Status status = twitter.updateStatus(message); //TODO\r
+       }\r
+       \r
+       private List<Train> getTrainList(){\r
+               TrainDao dao = TrainDao.getInstance();\r
+               List<Train> list = dao.search();\r
+               if (list.size() <= 0){\r
+                       Train train;\r
+                       \r
+                       train = new Train("\8b\9e\95l\93\8c\96k\90ü", "\8b\9e\95l\93\8c\96k", 5);\r
+                       dao.put(train);\r
+                       train = new Train("\93\8c\8aC\93¹\90ü", "\93\8c\8aC\93¹", 5);\r
+                       dao.put(train);\r
+                       train = new Train("\8b\9e\95l\8b}\8ds\90ü", "\8b\9e\8b}", 5);\r
+                       dao.put(train);\r
+                       list = dao.search();\r
                }\r
+               return list;\r
        }\r
        \r
        private static List<String> keywords = null;\r
index 99580d4..43ece7a 100644 (file)
@@ -4,6 +4,7 @@ import java.util.regex.Pattern;
 
 public class StringUtility {
        private static Pattern ptnAlnum = Pattern.compile("[a-zA-Z0-9]");
+       private static Pattern ptnSpace = Pattern.compile("\\s");
        private static Pattern ptnAscii = Pattern.compile("\\p{ASCII}");
        
        public static String parseSubstring(String text, int length){
@@ -20,19 +21,31 @@ public class StringUtility {
                        
                        if (ptnAlnum.matcher(ch).matches()){
                                if (status != 0){
-                                       pos = i;
+                                       if (status != 1){
+                                               pos = i;
+                                       }
                                        status = 0;
                                }
                        }
-                       else if (ptnAscii.matcher(ch).matches()){
+                       else if (ptnSpace.matcher(ch).matches()){
                                if (status != 1){
                                        pos = i;
                                        status = 1;
+                               }
+                       }
+                       else if (ptnAscii.matcher(ch).matches()){
+                               if (status != 2){
+                                       if (status != 1){
+                                               pos = i;
+                                       }
+                                       status = 2;
                                }                               
                        }
                        else {
-                               pos = i;
-                               status = 2;
+                               if (status != 1){
+                                       pos = i;
+                               }
+                               status = 3;
                        }
                }
                if (pos == 0){
diff --git a/workspace/TrainDelayBot/war/WEB-INF/appengine-generated/datastore-indexes-auto.xml b/workspace/TrainDelayBot/war/WEB-INF/appengine-generated/datastore-indexes-auto.xml
new file mode 100644 (file)
index 0000000..c58b291
--- /dev/null
@@ -0,0 +1,4 @@
+<!-- Indices written at Sun, 11 Mar 2012 10:58:19 UTC -->
+
+<datastore-indexes/>
+
index f58df06..732a460 100644 (file)
Binary files a/workspace/TrainDelayBot/war/WEB-INF/appengine-generated/local_db.bin and b/workspace/TrainDelayBot/war/WEB-INF/appengine-generated/local_db.bin differ