Github user robdouglas commented on a diff in the pull request:
https://github.com/apache/incubator-streams/pull/25#discussion_r12961501
--- Diff:
streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/serializer/TwitterJsonActivitySerializer.java
---
@@ -81,6 +87,48 @@ else if( documentSubType == Delete.class )
throw new NotImplementedException();
}
+ public static Actor buildActorRetweet(Retweet tweet) {
+ return buildActor(tweet.getUser());
+ }
+
+ public static Actor buildActorTweet(Tweet tweet) {
+ return buildActor(tweet.getUser());
+ }
+
+ public static Actor buildActor(User user) {
+ Actor actor = new Actor();
+
+ actor.setId(formatId(
+ Optional.fromNullable(
+ user.getIdStr())
+ .or(Optional.of(user.getId().toString()))
+ .orNull()
+ ));
+ actor.setDisplayName(user.getScreenName());
+ if (user.getUrl()!=null){
+ actor.setUrl(user.getUrl());
+ }
+
+ actor.setDisplayName(user.getName());
+ actor.setSummary(user.getDescription());
+
+ Map<String, Object> extensions = new HashMap<String, Object>();
+ extensions.put("location", user.getLocation());
+ extensions.put("posts", user.getStatusesCount());
+ extensions.put("favorites", user.getFavouritesCount());
--- End diff --
Correct, however the extensions here are for the actors. So it's only
recording the total number of: posts, favorites and followers for this actor at
this particular time. The perspectival flag is included in the
addTwitterExtensions function in both the Tweet and Retweet serializers
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---