You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streams.apache.org by mf...@apache.org on 2014/05/27 19:02:50 UTC
[1/4] git commit: STREAMS-88 | Updated the TwitterEventClassifier
(and subsequent tests) to react appropriately to 'User' objects. The
TwitterProfileProcessor can now process on 'User' objects as well
Repository: incubator-streams
Updated Branches:
refs/heads/master 0fc460695 -> 8d7cf5c0a
STREAMS-88 | Updated the TwitterEventClassifier (and subsequent tests) to react appropriately to 'User' objects. The TwitterProfileProcessor can now process on 'User' objects as well
Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/8fed2088
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/8fed2088
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/8fed2088
Branch: refs/heads/master
Commit: 8fed2088306e4439e6d64b0919939af6d927d0fc
Parents: aa376fd
Author: Robert Douglas <rd...@w2odigital.com>
Authored: Thu May 22 12:03:34 2014 -0500
Committer: Robert Douglas <rd...@w2odigital.com>
Committed: Thu May 22 12:03:34 2014 -0500
----------------------------------------------------------------------
.../processor/TwitterProfileProcessor.java | 27 ++++++++++++--------
.../provider/TwitterEventClassifier.java | 6 +++--
.../test/TwitterEventClassifierTest.java | 9 +++++++
3 files changed, 29 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/8fed2088/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterProfileProcessor.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterProfileProcessor.java b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterProfileProcessor.java
index 97bcbaf..8b09894 100644
--- a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterProfileProcessor.java
+++ b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterProfileProcessor.java
@@ -9,6 +9,7 @@ import org.apache.streams.twitter.pojo.Retweet;
import org.apache.streams.twitter.pojo.Tweet;
import org.apache.streams.twitter.pojo.User;
import org.apache.streams.twitter.provider.TwitterEventClassifier;
+import org.apache.streams.twitter.serializer.StreamsTwitterMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -23,7 +24,7 @@ public class TwitterProfileProcessor implements StreamsProcessor, Runnable {
private final static Logger LOGGER = LoggerFactory.getLogger(TwitterProfileProcessor.class);
- private ObjectMapper mapper = new ObjectMapper();
+ private ObjectMapper mapper = new StreamsTwitterMapper();
private Queue<StreamsDatum> inQueue;
private Queue<StreamsDatum> outQueue;
@@ -35,18 +36,18 @@ public class TwitterProfileProcessor implements StreamsProcessor, Runnable {
while(true) {
StreamsDatum item;
- try {
- item = inQueue.poll();
- if(item.getDocument() instanceof String && item.equals(TERMINATE)) {
- LOGGER.info("Terminating!");
- break;
- }
+ try {
+ item = inQueue.poll();
+ if(item.getDocument() instanceof String && item.equals(TERMINATE)) {
+ LOGGER.info("Terminating!");
+ break;
+ }
- Thread.sleep(new Random().nextInt(100));
+ Thread.sleep(new Random().nextInt(100));
- for( StreamsDatum entry : process(item)) {
- outQueue.offer(entry);
- }
+ for( StreamsDatum entry : process(item)) {
+ outQueue.offer(entry);
+ }
} catch (Exception e) {
@@ -85,6 +86,10 @@ public class TwitterProfileProcessor implements StreamsProcessor, Runnable {
Retweet retweet = mapper.readValue(item, Retweet.class);
user = retweet.getRetweetedStatus().getUser();
result.add(new StreamsDatum(user));
+ } else if ( inClass.equals( User.class )) {
+ LOGGER.debug("USER");
+ user = mapper.readValue(item, User.class);
+ result.add(new StreamsDatum(user));
} else {
return Lists.newArrayList();
}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/8fed2088/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterEventClassifier.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterEventClassifier.java b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterEventClassifier.java
index 3a8bf6d..8ec9bb0 100644
--- a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterEventClassifier.java
+++ b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterEventClassifier.java
@@ -40,15 +40,17 @@ public class TwitterEventClassifier {
return null;
}
- if( objectNode.findValue("retweeted_status") != null )
+ if( objectNode.findValue("retweeted_status") != null && objectNode.get("retweeted_status") != null)
return Retweet.class;
else if( objectNode.findValue("delete") != null )
return Delete.class;
else if( objectNode.findValue("friends") != null ||
- objectNode.findValue("friends_str") != null )
+ objectNode.findValue("friends_str") != null )
return FriendList.class;
else if( objectNode.findValue("target_object") != null )
return UserstreamEvent.class;
+ else if ( objectNode.findValue("location") != null && objectNode.findValue("user") == null)
+ return User.class;
else
return Tweet.class;
}
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/8fed2088/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/TwitterEventClassifierTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/TwitterEventClassifierTest.java b/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/TwitterEventClassifierTest.java
index 83e816a..a22901f 100644
--- a/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/TwitterEventClassifierTest.java
+++ b/streams-contrib/streams-provider-twitter/src/test/java/org/apache/streams/twitter/test/TwitterEventClassifierTest.java
@@ -3,6 +3,7 @@ package org.apache.streams.twitter.test;
import org.apache.streams.twitter.pojo.Delete;
import org.apache.streams.twitter.pojo.Retweet;
import org.apache.streams.twitter.pojo.Tweet;
+import org.apache.streams.twitter.pojo.User;
import org.apache.streams.twitter.provider.TwitterEventClassifier;
import org.junit.Assert;
import org.junit.Test;
@@ -15,6 +16,7 @@ public class TwitterEventClassifierTest {
private String tweet = "{\"created_at\":\"Wed Dec 11 22:27:34 +0000 2013\",\"id\":410898682381615105,\"id_str\":\"410898682381615105\",\"text\":\"Men's Basketball Single-Game Tickets Available - A limited number of tickets remain for Kentucky's upcoming men's ... http:\\/\\/t.co\\/SH5YZGpdRx\",\"source\":\"\\u003ca href=\\\"http:\\/\\/www.hootsuite.com\\\" rel=\\\"nofollow\\\"\\u003eHootSuite\\u003c\\/a\\u003e\",\"truncated\":false,\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":91407775,\"id_str\":\"91407775\",\"name\":\"Winchester, KY\",\"screen_name\":\"winchester_ky\",\"location\":\"\",\"url\":null,\"description\":null,\"protected\":false,\"followers_count\":136,\"friends_count\":0,\"listed_count\":1,\"created_at\":\"Fri Nov 20 19:29:02 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":fa
lse,\"statuses_count\":1793,\"lang\":\"en\",\"contributors_enabled\":false,\"is_translator\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\/\\/abs.twimg.com\\/images\\/themes\\/theme1\\/bg.png\",\"profile_background_image_url_https\":\"https:\\/\\/abs.twimg.com\\/images\\/themes\\/theme1\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\/\\/pbs.twimg.com\\/profile_images\\/613854495\\/winchester_sociallogo_normal.jpg\",\"profile_image_url_https\":\"https:\\/\\/pbs.twimg.com\\/profile_images\\/613854495\\/winchester_sociallogo_normal.jpg\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors
\":null,\"retweet_count\":0,\"favorite_count\":0,\"entities\":{\"hashtags\":[],\"symbols\":[],\"urls\":[{\"url\":\"http:\\/\\/t.co\\/SH5YZGpdRx\",\"expanded_url\":\"http:\\/\\/ow.ly\\/2C2XL1\",\"display_url\":\"ow.ly\\/2C2XL1\",\"indices\":[118,140]}],\"user_mentions\":[]},\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"filter_level\":\"medium\",\"lang\":\"en\"}\n";
private String retweet = "{\"created_at\":\"Wed Dec 11 22:27:34 +0000 2013\",\"id\":410898682385797121,\"id_str\":\"410898682385797121\",\"text\":\"RT @hemocional: Cuando te acarici\\u00e9 me di cuenta que hab\\u00eda vivido toda mi vida con las manos vac\\u00edas.\\nALEJANDRO JODOROWSKY.\",\"source\":\"web\",\"truncated\":false,\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":163149656,\"id_str\":\"163149656\",\"name\":\"Carolina\",\"screen_name\":\"_titinaok\",\"location\":\"Montevideo\",\"url\":\"http:\\/\\/www.youtube.com\\/watch?v=N3v5vZ-tU1E\",\"description\":\"Tantas veces me defin\\u00ed ...Soy nada y todo a la vez\",\"protected\":false,\"followers_count\":41,\"friends_count\":75,\"listed_count\":2,\"created_at\":\"Mon Jul 05 17:35:49 +0000 2010\",\"favourites_count\":4697,\"utc_offset\":-10800,\"time_zone\":\"Buenos Aires\",\"geo_enabled\":fal
se,\"verified\":false,\"statuses_count\":5257,\"lang\":\"es\",\"contributors_enabled\":false,\"is_translator\":false,\"profile_background_color\":\"C4A64B\",\"profile_background_image_url\":\"http:\\/\\/a0.twimg.com\\/profile_background_images\\/378800000096791690\\/f64a07abbaa735b39ad7655fdaa2f416.jpeg\",\"profile_background_image_url_https\":\"https:\\/\\/si0.twimg.com\\/profile_background_images\\/378800000096791690\\/f64a07abbaa735b39ad7655fdaa2f416.jpeg\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\/\\/pbs.twimg.com\\/profile_images\\/378800000799213504\\/496d008f457390005825d2eb4ca50a63_normal.jpeg\",\"profile_image_url_https\":\"https:\\/\\/pbs.twimg.com\\/profile_images\\/378800000799213504\\/496d008f457390005825d2eb4ca50a63_normal.jpeg\",\"profile_banner_url\":\"https:\\/\\/pbs.twimg.com\\/profile_banners\\/163149656\\/1379722210\",\"profile_link_color\":\"BF415A\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"B17CED\",\"pr
ofile_text_color\":\"3D1957\",\"profile_use_background_image\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Wed Dec 11 22:25:06 +0000 2013\",\"id\":410898060206960640,\"id_str\":\"410898060206960640\",\"text\":\"Cuando te acarici\\u00e9 me di cuenta que hab\\u00eda vivido toda mi vida con las manos vac\\u00edas.\\nALEJANDRO JODOROWSKY.\",\"source\":\"\\u003ca href=\\\"http:\\/\\/bufferapp.com\\\" rel=\\\"nofollow\\\"\\u003eBuffer\\u003c\\/a\\u003e\",\"truncated\":false,\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":552929456,\"id_str\":\"552929456\",\"name\":\"Habilidad emocional\",\"screen_name\":\"hemocional\",\"location\":\"\",\"url\":\"http:\\/\\/www.hab
ilidademocional.com\",\"description\":\"Pensamientos y reflexiones para ayudar a mirar la vida de una manera m\\u00e1s saludable y a crecer interiormente cada d\\u00eda m\\u00e1s. #InteligenciaEmocional #Psicolog\\u00eda\",\"protected\":false,\"followers_count\":34307,\"friends_count\":325,\"listed_count\":361,\"created_at\":\"Fri Apr 13 19:00:11 +0000 2012\",\"favourites_count\":44956,\"utc_offset\":3600,\"time_zone\":\"Madrid\",\"geo_enabled\":false,\"verified\":false,\"statuses_count\":24011,\"lang\":\"es\",\"contributors_enabled\":false,\"is_translator\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\/\\/a0.twimg.com\\/profile_background_images\\/378800000123681920\\/aab7226ae139f0ff93b04a08a8541477.jpeg\",\"profile_background_image_url_https\":\"https:\\/\\/si0.twimg.com\\/profile_background_images\\/378800000123681920\\/aab7226ae139f0ff93b04a08a8541477.jpeg\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\/\\/pbs.twimg
.com\\/profile_images\\/2430091220\\/zdkea46xhe3g4e65nuwl_normal.gif\",\"profile_image_url_https\":\"https:\\/\\/pbs.twimg.com\\/profile_images\\/2430091220\\/zdkea46xhe3g4e65nuwl_normal.gif\",\"profile_banner_url\":\"https:\\/\\/pbs.twimg.com\\/profile_banners\\/552929456\\/1383180255\",\"profile_link_color\":\"FF00E1\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"F3F3F3\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweet_count\":9,\"favorite_count\":6,\"entities\":{\"hashtags\":[],\"symbols\":[],\"urls\":[],\"user_mentions\":[]},\"favorited\":false,\"retweeted\":false,\"lang\":\"es\"},\"retweet_count\":0,\"favorite_count\":0,\"entities\":{\"hashtags\":[],\"symbols\":[],\"urls\":[],\"user_mentions\":[{\"screen_name\":\"he
mocional\",\"name\":\"Habilidad emocional\",\"id\":552929456,\"id_str\":\"552929456\",\"indices\":[3,14]}]},\"favorited\":false,\"retweeted\":false,\"filter_level\":\"medium\",\"lang\":\"es\"}\n";
private String delete = "{\"delete\":{\"status\":{\"id\":377518972486553600,\"user_id\":1249045572,\"id_str\":\"377518972486553600\",\"user_id_str\":\"1249045572\"}}}\n";
+ private String user = "{\"location\":\"\",\"default_profile\":true,\"profile_background_tile\":false,\"statuses_count\":1,\"lang\":\"en\",\"profile_link_color\":\"0084B4\",\"id\":32386852,\"following\":false,\"protected\":false,\"favourites_count\":0,\"profile_text_color\":\"333333\",\"description\":\"\",\"verified\":false,\"contributors_enabled\":false,\"profile_sidebar_border_color\":\"C0DEED\",\"name\":\"Fred Gilkey\",\"profile_background_color\":\"C0DEED\",\"created_at\":\"Fri Apr 17 12:35:56 +0000 2009\",\"is_translation_enabled\":false,\"default_profile_image\":true,\"followers_count\":2,\"profile_image_url_https\":\"https://abs.twimg.com/sticky/default_profile_images/default_profile_1_normal.png\",\"geo_enabled\":false,\"status\":{\"contributors\":null,\"text\":\"Working\",\"geo\":null,\"retweeted\":false,\"in_reply_to_screen_name\":null,\"truncated\":false,\"lang\":\"en\",\"entities\":{\"symbols\":[],\"urls\":[],\"hashtags\":[],\"user_mentions\":[]},\"in_reply_to_status_
id_str\":null,\"id\":1541596700,\"source\":\"web\",\"in_reply_to_user_id_str\":null,\"favorited\":false,\"in_reply_to_status_id\":null,\"retweet_count\":0,\"created_at\":\"Fri Apr 17 12:37:54 +0000 2009\",\"in_reply_to_user_id\":null,\"favorite_count\":0,\"id_str\":\"1541596700\",\"place\":null,\"coordinates\":null},\"profile_background_image_url\":\"http://abs.twimg.com/images/themes/theme1/bg.png\",\"profile_background_image_url_https\":\"https://abs.twimg.com/images/themes/theme1/bg.png\",\"follow_request_sent\":false,\"entities\":{\"description\":{\"urls\":[]}},\"url\":null,\"utc_offset\":null,\"time_zone\":null,\"notifications\":false,\"profile_use_background_image\":true,\"friends_count\":1,\"profile_sidebar_fill_color\":\"DDEEF6\",\"screen_name\":\"4TYLove\",\"id_str\":\"32386852\",\"profile_image_url\":\"http://abs.twimg.com/sticky/default_profile_images/default_profile_1_normal.png\",\"listed_count\":0,\"is_translator\":false}";
@Test
public void testDetectTweet() {
@@ -36,4 +38,11 @@ public class TwitterEventClassifierTest {
if( !result.equals(Delete.class) )
Assert.fail();
}
+
+ @Test
+ public void testDetectUser() {
+ Class result = TwitterEventClassifier.detectClass(user);
+ if( !result.equals(User.class) )
+ Assert.fail();
+ }
}
[4/4] git commit: Fixed merge error for PR#26
Posted by mf...@apache.org.
Fixed merge error for PR#26
Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/8d7cf5c0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/8d7cf5c0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/8d7cf5c0
Branch: refs/heads/master
Commit: 8d7cf5c0a4ea7accd5d4e1f59c8daf2b9c4dd484
Parents: 2fa748e
Author: mfranklin <mf...@apache.org>
Authored: Tue May 27 12:53:12 2014 -0400
Committer: mfranklin <mf...@apache.org>
Committed: Tue May 27 12:53:12 2014 -0400
----------------------------------------------------------------------
.../streams/twitter/serializer/util/TwitterActivityUtil.java | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/8d7cf5c0/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/serializer/util/TwitterActivityUtil.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/serializer/util/TwitterActivityUtil.java b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/serializer/util/TwitterActivityUtil.java
index 8ead14c..feb6978 100644
--- a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/serializer/util/TwitterActivityUtil.java
+++ b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/serializer/util/TwitterActivityUtil.java
@@ -75,13 +75,7 @@ public class TwitterActivityUtil {
activity.setProvider(getProvider());
activity.setUrl(String.format("http://twitter.com/%s/%s/%s", tweet.getUser().getScreenName(),"/status/",tweet.getIdStr()));
- activity.setTitle("");
- activity.setContent(tweet.getText());
- activity.setLinks(getLinks(tweet));
-
addTwitterExtension(activity, mapper.convertValue(tweet, ObjectNode.class));
- addLocationExtension(activity, tweet);
- addTwitterExtensions(activity, tweet);
}
/**
@@ -138,6 +132,8 @@ public class TwitterActivityUtil {
activity.setObject(buildActivityObject(tweet));
activity.setLinks(getLinks(tweet));
activity.setContent(tweet.getText());
+ addLocationExtension(activity, tweet);
+ addTwitterExtensions(activity, tweet);
}
}
[2/4] git commit: STREAMS-95 | TwitterProfileProcessor now constructs
all StreamsDatums with the user's unique ID (from Twitter)
Posted by mf...@apache.org.
STREAMS-95 | TwitterProfileProcessor now constructs all StreamsDatums with the user's unique ID (from Twitter)
Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/ea3f312c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/ea3f312c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/ea3f312c
Branch: refs/heads/master
Commit: ea3f312c479fb35693b4cbf291ad02b2c77f24d9
Parents: 8fed208
Author: Robert Douglas <rd...@w2odigital.com>
Authored: Thu May 22 15:32:49 2014 -0500
Committer: Robert Douglas <rd...@w2odigital.com>
Committed: Thu May 22 15:32:49 2014 -0500
----------------------------------------------------------------------
.../streams/twitter/processor/TwitterProfileProcessor.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/ea3f312c/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterProfileProcessor.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterProfileProcessor.java b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterProfileProcessor.java
index 8b09894..c42943f 100644
--- a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterProfileProcessor.java
+++ b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/processor/TwitterProfileProcessor.java
@@ -79,17 +79,17 @@ public class TwitterProfileProcessor implements StreamsProcessor, Runnable {
LOGGER.debug("TWEET");
Tweet tweet = mapper.readValue(item, Tweet.class);
user = tweet.getUser();
- result.add(new StreamsDatum(user));
+ result.add(new StreamsDatum(user, user.getIdStr()));
}
else if ( inClass.equals( Retweet.class )) {
LOGGER.debug("RETWEET");
Retweet retweet = mapper.readValue(item, Retweet.class);
user = retweet.getRetweetedStatus().getUser();
- result.add(new StreamsDatum(user));
+ result.add(new StreamsDatum(user, user.getIdStr()));
} else if ( inClass.equals( User.class )) {
LOGGER.debug("USER");
user = mapper.readValue(item, User.class);
- result.add(new StreamsDatum(user));
+ result.add(new StreamsDatum(user, user.getIdStr()));
} else {
return Lists.newArrayList();
}
[3/4] git commit: Merge PR#26 from robdouglas 'rdouglas/STREAMS-88'
Posted by mf...@apache.org.
Merge PR#26 from robdouglas 'rdouglas/STREAMS-88'
Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/2fa748e3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/2fa748e3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/2fa748e3
Branch: refs/heads/master
Commit: 2fa748e3ac9f050ea4fd5321d68e23ca15eded65
Parents: 0fc4606 ea3f312
Author: mfranklin <mf...@apache.org>
Authored: Tue May 27 12:39:43 2014 -0400
Committer: mfranklin <mf...@apache.org>
Committed: Tue May 27 12:39:43 2014 -0400
----------------------------------------------------------------------
.../processor/TwitterProfileProcessor.java | 31 ++++++++++++--------
.../provider/TwitterEventClassifier.java | 6 ++--
.../test/TwitterEventClassifierTest.java | 9 ++++++
3 files changed, 31 insertions(+), 15 deletions(-)
----------------------------------------------------------------------