From 8c776bee976f85ea880cec62c1561c76c49eafe6 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Fri, 14 Oct 2011 17:46:35 +0200 Subject: [PATCH] use twitter4j 2.5 snapshot version as its the only version that works with the change of the endpoint --- .idea/modules/plugin-river-twitter.iml | 7 +++---- plugins/river/twitter/build.gradle | 12 ++++++++---- .../elasticsearch/river/twitter/TwitterRiver.java | 8 +++++--- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.idea/modules/plugin-river-twitter.iml b/.idea/modules/plugin-river-twitter.iml index d85d3334e90..146cdeb7d58 100644 --- a/.idea/modules/plugin-river-twitter.iml +++ b/.idea/modules/plugin-river-twitter.iml @@ -15,12 +15,11 @@ - + + - - - + diff --git a/plugins/river/twitter/build.gradle b/plugins/river/twitter/build.gradle index 7d1e57ae266..6983928f87b 100644 --- a/plugins/river/twitter/build.gradle +++ b/plugins/river/twitter/build.gradle @@ -30,13 +30,17 @@ configurations { } } +repositories { + mavenRepo urls: 'http://twitter4j.org/maven2' +} + dependencies { compile project(':elasticsearch') - compile('org.twitter4j:twitter4j-core:2.2.4') { transitive = false } - compile('org.twitter4j:twitter4j-stream:2.2.4') { transitive = false } - compile('org.twitter4j:twitter4j-core:2.2.4') { transitive = false } - compile('org.twitter4j:twitter4j-stream:2.2.4') { transitive = false } + compile('org.twitter4j:twitter4j-core:2.2.5-SNAPSHOT') { transitive = false } + compile('org.twitter4j:twitter4j-stream:2.2.5-SNAPSHOT') { transitive = false } + compile('org.twitter4j:twitter4j-core:2.2.5-SNAPSHOT') { transitive = false } + compile('org.twitter4j:twitter4j-stream:2.2.5-SNAPSHOT') { transitive = false } } task explodedDist(dependsOn: [jar], description: 'Builds the plugin zip file') << { diff --git a/plugins/river/twitter/src/main/java/org/elasticsearch/river/twitter/TwitterRiver.java b/plugins/river/twitter/src/main/java/org/elasticsearch/river/twitter/TwitterRiver.java index 550d6b1dc76..92bb9c34c19 100644 --- a/plugins/river/twitter/src/main/java/org/elasticsearch/river/twitter/TwitterRiver.java +++ b/plugins/river/twitter/src/main/java/org/elasticsearch/river/twitter/TwitterRiver.java @@ -265,8 +265,8 @@ public class TwitterRiver extends AbstractRiverComponent implements River { } currentRequest = client.prepareBulk(); if (streamType.equals("filter") || filterQuery != null) { - - stream.filter(filterQuery); + + stream.filter(filterQuery); } else if (streamType.equals("firehose")) { stream.firehose(0); @@ -416,7 +416,9 @@ public class TwitterRiver extends AbstractRiverComponent implements River { for (URLEntity url : status.getURLEntities()) { if (url != null) { builder.startObject(); - builder.field("url", url.getURL().toExternalForm()); + if (url.getURL() != null) { + builder.field("url", url.getURL().toExternalForm()); + } if (url.getDisplayURL() != null) { builder.field("display_url", url.getDisplayURL()); }