streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (STREAMS-93) Add generic extensions from multiple providers
Date Thu, 22 May 2014 17:11:02 GMT

    [ https://issues.apache.org/jira/browse/STREAMS-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14006140#comment-14006140
] 

ASF GitHub Bot commented on STREAMS-93:
---------------------------------------

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


> Add generic extensions from multiple providers
> ----------------------------------------------
>
>                 Key: STREAMS-93
>                 URL: https://issues.apache.org/jira/browse/STREAMS-93
>             Project: Streams
>          Issue Type: Task
>            Reporter: Robert Douglas
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> At the moment, if we want to grab out things like "hashtags" or "Number of Likes" from
an activity, we have to delve into that provider's extension. So, for example, "extensions.twitter.entities.hashtags.text".
There are certain attributes that are consistent across multiple providers and could benefit
from being placed at the top level of the "extensions" attribute. 
> These would include things like "hashtags", "rebroadcasts", "likes", "user_mentions",
and "urls"



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message