diff --git a/buildnum.properties b/buildnum.properties index cc5bbaa..096cb20 100644 --- a/buildnum.properties +++ b/buildnum.properties @@ -1,3 +1,3 @@ #ANT Task: ch.oscg.jreleaseinfo.BuildNumberHandler -#Fri Aug 24 02:59:30 PDT 2012 -build.num.last=4 +#Wed Jun 12 14:18:56 PDT 2013 +build.num.last=10 diff --git a/lib/commons-codec-1.4.jar b/lib/commons-codec-1.4.jar deleted file mode 100644 index 458d432..0000000 Binary files a/lib/commons-codec-1.4.jar and /dev/null differ diff --git a/lib/commons-codec-1.8.jar b/lib/commons-codec-1.8.jar new file mode 100644 index 0000000..32f84c9 Binary files /dev/null and b/lib/commons-codec-1.8.jar differ diff --git a/lib/json.jar b/lib/json.jar new file mode 100644 index 0000000..fe51b50 Binary files /dev/null and b/lib/json.jar differ diff --git a/lib/twitter4j-core-2.1.5-SNAPSHOT.jar b/lib/twitter4j-core-2.1.5-SNAPSHOT.jar deleted file mode 100644 index b427075..0000000 Binary files a/lib/twitter4j-core-2.1.5-SNAPSHOT.jar and /dev/null differ diff --git a/lib/twitter4j-core-3.0.3.jar b/lib/twitter4j-core-3.0.3.jar new file mode 100644 index 0000000..b9394f4 Binary files /dev/null and b/lib/twitter4j-core-3.0.3.jar differ diff --git a/mobibot.iml b/mobibot.iml index ca3aa60..9ebf5ab 100644 --- a/mobibot.iml +++ b/mobibot.iml @@ -134,15 +134,6 @@ - - - - - - - - - @@ -170,6 +161,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/mobibot.ipr b/mobibot.ipr index 9c565c9..995cc86 100644 --- a/mobibot.ipr +++ b/mobibot.ipr @@ -1,14 +1,8 @@ - - - - - - - + @@ -75,7 +69,11 @@ - + + + + + @@ -291,6 +289,7 @@ - + - - - + + + + + + + + + + + - + + + @@ -135,14 +149,38 @@ - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -150,7 +188,7 @@ - + @@ -211,6 +249,11 @@ + + + @@ -288,10 +331,9 @@ - @@ -583,13 +641,9 @@ - - + @@ -760,7 +788,7 @@ - + - - + + - - + + - + - - + + + @@ -910,12 +939,14 @@ + + @@ -957,19 +988,24 @@ @@ -1051,11 +1090,6 @@ - - - - - @@ -1076,16 +1110,6 @@ - - - - - - - - - - @@ -1098,41 +1122,71 @@ - + + + - + + + - + + + - + + + - + + + - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/net/thauvin/erik/mobibot/Identica.java b/src/net/thauvin/erik/mobibot/Identica.java index 4141c1e..a24e065 100644 --- a/src/net/thauvin/erik/mobibot/Identica.java +++ b/src/net/thauvin/erik/mobibot/Identica.java @@ -36,9 +36,9 @@ */ package net.thauvin.erik.mobibot; +import org.json.XML; import twitter4j.internal.http.BASE64Encoder; -import twitter4j.internal.org.json.JSONObject; -import twitter4j.internal.org.json.XML; +import org.json.JSONObject; import java.io.BufferedReader; import java.io.InputStreamReader; diff --git a/src/net/thauvin/erik/mobibot/ReleaseInfo.java b/src/net/thauvin/erik/mobibot/ReleaseInfo.java index f02a294..b0bfbc7 100644 --- a/src/net/thauvin/erik/mobibot/ReleaseInfo.java +++ b/src/net/thauvin/erik/mobibot/ReleaseInfo.java @@ -1,5 +1,5 @@ /* Created by JReleaseInfo AntTask from Open Source Competence Group */ -/* Creation date Fri Aug 24 02:59:30 PDT 2012 */ +/* Creation date Wed Jun 12 14:18:56 PDT 2013 */ package net.thauvin.erik.mobibot; import java.util.Date; @@ -20,21 +20,21 @@ public class ReleaseInfo { } - /** buildDate (set during build process to 1345802370733L). */ - private static final Date buildDate = new Date(1345802370733L); + /** buildDate (set during build process to 1371071936682L). */ + private static final Date buildDate = new Date(1371071936682L); /** - * Get buildDate (set during build process to Fri Aug 24 02:59:30 PDT 2012). + * Get buildDate (set during build process to Wed Jun 12 14:18:56 PDT 2013). * @return Date buildDate */ public static Date getBuildDate() { return buildDate; } /** - * Get buildNumber (set during build process to 4). + * Get buildNumber (set during build process to 10). * @return int buildNumber */ - public static int getBuildNumber() { return 4; } + public static int getBuildNumber() { return 10; } /** project (set during build process to "mobibot"). */ diff --git a/src/net/thauvin/erik/mobibot/Twitter.java b/src/net/thauvin/erik/mobibot/Twitter.java index ed8a907..29dcfdd 100644 --- a/src/net/thauvin/erik/mobibot/Twitter.java +++ b/src/net/thauvin/erik/mobibot/Twitter.java @@ -38,7 +38,7 @@ package net.thauvin.erik.mobibot; import twitter4j.Status; import twitter4j.TwitterFactory; -import twitter4j.http.AccessToken; +import twitter4j.conf.ConfigurationBuilder; /** * Inserts presence information into Twitter. @@ -112,17 +112,22 @@ public class Twitter implements Runnable { try { - final twitter4j.Twitter twitter = new TwitterFactory().getOAuthAuthorizedInstance(_consumerKey, - _consumerSecret, - new AccessToken( - _accessToken, - _accessTokenSecret)); + final ConfigurationBuilder cb = new ConfigurationBuilder(); + cb.setDebugEnabled(true).setOAuthConsumerKey(_consumerKey).setOAuthConsumerSecret(_consumerSecret) + .setOAuthAccessToken(_accessToken).setOAuthAccessTokenSecret(_accessTokenSecret); + final TwitterFactory tf = new TwitterFactory(cb.build()); + final twitter4j.Twitter twitter = tf.getInstance(); final Status status = twitter.updateStatus(_message + " (" + _sender + ')'); _bot.send(_sender, "You message was posted to http://twitter.com/" + twitter.getScreenName() + "/statuses/" + status .getId()); + + twitter.shutdown(); + + // @TODO Does it help? + twitter4j.internal.json.DataObjectFactoryUtil.clearThreadLocalMap(); } catch (Exception e) { diff --git a/src/net/thauvin/erik/mobibot/TwitterOAuth.java b/src/net/thauvin/erik/mobibot/TwitterOAuth.java index d2f8c73..ba9267f 100644 --- a/src/net/thauvin/erik/mobibot/TwitterOAuth.java +++ b/src/net/thauvin/erik/mobibot/TwitterOAuth.java @@ -2,8 +2,8 @@ package net.thauvin.erik.mobibot; import twitter4j.TwitterException; import twitter4j.TwitterFactory; -import twitter4j.http.AccessToken; -import twitter4j.http.RequestToken; +import twitter4j.auth.AccessToken; +import twitter4j.auth.RequestToken; import java.io.BufferedReader; import java.io.InputStreamReader;