From 7a3d751fa742fcef3f6faa8cf04c8948a0744c9e Mon Sep 17 00:00:00 2001 From: Michael Winsauer Date: Mon, 10 Dec 2018 21:38:22 +0100 Subject: [PATCH] Filter retweets from output, as they are redundant. --- .../at/aic18/g6t4/servicetwitter/service/TwitterService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/service/TwitterService.java b/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/service/TwitterService.java index d676835..bb1878b 100644 --- a/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/service/TwitterService.java +++ b/service-twitter/src/main/java/at/aic18/g6t4/servicetwitter/service/TwitterService.java @@ -8,6 +8,8 @@ import twitter4j.*; import java.util.List; import java.util.stream.Collectors; +import static java.util.function.Predicate.not; + @Service public class TwitterService { @@ -27,6 +29,7 @@ public class TwitterService { private List parseTweets(List statusList) { return statusList.stream() + .filter(not(Status::isRetweet)) .map(this::parseTweet) .collect(Collectors.toList()); } -- 2.43.0