streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfranklin <...@git.apache.org>
Subject [GitHub] incubator-streams pull request: STREAMS-93 | Updated the Hashtag P...
Date Thu, 22 May 2014 17:09:28 GMT
Github user mfranklin commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/25#discussion_r12961473
  
    --- 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 --
    
    NM, I see now this is on the actor object


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message