You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streams.apache.org by robdouglas <gi...@git.apache.org> on 2014/07/02 18:21:09 UTC

[GitHub] incubator-streams pull request: Streams 122

GitHub user robdouglas opened a pull request:

    https://github.com/apache/incubator-streams/pull/49

    Streams 122

    Updated the InstagramActivityUtil class to fully map Instagram MediaFeedData objects to Activities. Updated tests so that this deserialization and mapping can be tested.
    
    Updated the InstagramTypeConverter to use the conversion utility functions provided in InstagramActivityUtil

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/robdouglas/incubator-streams STREAMS-122

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-streams/pull/49.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #49
    
----
commit 2ee31575eba481bf77c98a9edfe3d04eae333f16
Author: Robert Douglas <rd...@w2odigital.com>
Date:   2014-06-23T19:03:00Z

    Merge pull request #4 from apache/master
    
    Merge Apache

commit d71b159d1996a939cccede70b509c1767478aa72
Author: Robert Douglas <rd...@w2odigital.com>
Date:   2014-06-27T21:43:57Z

    Merge pull request #5 from apache/master
    
    Merge From Apache

commit 3b98df844ca87e79bf9cb88f16fbad361d9959ad
Author: Robert Douglas <rd...@w2odigital.com>
Date:   2014-07-01T14:56:26Z

    Merge pull request #6 from apache/master
    
    Merge Apache

commit 7b301ceaa358e6c572b95a0eff754a87cf9f6064
Author: Robert Douglas <rd...@w2odigital.com>
Date:   2014-07-01T22:11:28Z

    Merge branch 'instagram' into STREAMS-122

commit 116365355dad985da52092c85378b5bd7497e907
Author: Robert Douglas <rd...@w2odigital.com>
Date:   2014-07-01T22:12:57Z

    STREAMS-122 | Updated the InstagramActivityUtil class to fully map Instagram MediaFeedData objects to Activities. Updated tests so that this deserialization and mapping can be tested

commit fa3f92200d19605e931954a154e59123d1a36f03
Author: Robert Douglas <rd...@w2odigital.com>
Date:   2014-07-02T15:48:35Z

    STREAMS-105 | Updated the InstagramTypeConverter to use the conversion utility functions provided in InstagramActivityUtil

commit 23bfcac82884d3280815f1168b82e263f38ef1fb
Author: Robert Douglas <rd...@w2odigital.com>
Date:   2014-07-02T16:17:27Z

    Merge branch 'instagram' into STREAMS-122

commit 957e13f9d0bcf330d40e47691ce2c9b8a038781a
Author: Robert Douglas <rd...@w2odigital.com>
Date:   2014-07-02T16:19:57Z

    STREAMS-122 | Added header

----


---
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.
---

[GitHub] incubator-streams pull request: Streams 122

Posted by robdouglas <gi...@git.apache.org>.
Github user robdouglas commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/49#discussion_r14605241
  
    --- Diff: streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/util/InstagramActivityUtil.java ---
    @@ -138,5 +247,30 @@ public static String formatId(String... idparts) {
          */
         public static void addInstagramExtensions(Activity activity, MediaFeedData item) {
    --- End diff --
    
    Added it in. Keywords will now contain a concatenation of all comments and captions for a given post


---
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.
---

[GitHub] incubator-streams pull request: Streams 122

Posted by steveblackmon <gi...@git.apache.org>.
Github user steveblackmon commented on the pull request:

    https://github.com/apache/incubator-streams/pull/49#issuecomment-47831217
  
    looks good


---
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.
---

[GitHub] incubator-streams pull request: Streams 122

Posted by mfranklin <gi...@git.apache.org>.
Github user mfranklin commented on the pull request:

    https://github.com/apache/incubator-streams/pull/49#issuecomment-48378972
  
    :+1: 


---
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.
---

[GitHub] incubator-streams pull request: Streams 122

Posted by mfranklin <gi...@git.apache.org>.
Github user mfranklin commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/49#discussion_r14595626
  
    --- Diff: streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/util/InstagramActivityUtil.java ---
    @@ -47,7 +52,24 @@
          * @throws ActivitySerializerException
          */
         public static void updateActivity(MediaFeedData item, Activity activity) throws ActivitySerializerException {
    +        activity.setActor(buildActor(item));
    +
    +        if(item.getCreatedTime() != null)
    +            activity.setPublished(new DateTime(Long.parseLong(item.getCreatedTime()) * 1000));
    +
    +        activity.setId(formatId(activity.getVerb(),
    --- End diff --
    
    where is getVerb set?


---
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.
---

[GitHub] incubator-streams pull request: Streams 122

Posted by robdouglas <gi...@git.apache.org>.
Github user robdouglas commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/49#discussion_r14605251
  
    --- Diff: streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/util/InstagramActivityUtil.java ---
    @@ -47,7 +52,24 @@
          * @throws ActivitySerializerException
          */
         public static void updateActivity(MediaFeedData item, Activity activity) throws ActivitySerializerException {
    +        activity.setActor(buildActor(item));
    +
    +        if(item.getCreatedTime() != null)
    +            activity.setPublished(new DateTime(Long.parseLong(item.getCreatedTime()) * 1000));
    +
    +        activity.setId(formatId(activity.getVerb(),
    --- End diff --
    
    Added a call to set it in updateActivity


---
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.
---

[GitHub] incubator-streams pull request: Streams 122

Posted by mfranklin <gi...@git.apache.org>.
Github user mfranklin commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/49#discussion_r14595702
  
    --- Diff: streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/util/InstagramActivityUtil.java ---
    @@ -138,5 +247,30 @@ public static String formatId(String... idparts) {
          */
         public static void addInstagramExtensions(Activity activity, MediaFeedData item) {
    --- End diff --
    
    it looks like we are missing the keywords extension


---
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.
---

[GitHub] incubator-streams pull request: Streams 122

Posted by mfranklin <gi...@git.apache.org>.
Github user mfranklin commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/49#discussion_r14595421
  
    --- Diff: streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/util/InstagramActivityUtil.java ---
    @@ -98,7 +208,14 @@ public static void updateActivityContent(Activity activity, MediaFeedData item,
          */
         public static void addLocationExtension(Activity activity, MediaFeedData item) {
             Map<String, Object> extensions = ensureExtensions(activity);
    -        Map<String, Object> location = new HashMap<String, Object>();
    +
    +        if(item.getLocation() != null) {
    +            Map<String, Object> coordinates = new HashMap<String, Object>();
    +            coordinates.put("type", "Point");
    +            coordinates.put("coordinates", "[" + item.getLocation().getLatitude() + "," + item.getLocation().getLongitude() + "]");
    --- End diff --
    
    GeoJSON is long, lat
    
    http://geojson.org/geojson-spec.html#id2


---
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.
---

[GitHub] incubator-streams pull request: Streams 122

Posted by mfranklin <gi...@git.apache.org>.
Github user mfranklin commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/49#discussion_r14595463
  
    --- Diff: streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/util/InstagramActivityUtil.java ---
    @@ -138,5 +247,30 @@ public static String formatId(String... idparts) {
          */
         public static void addInstagramExtensions(Activity activity, MediaFeedData item) {
             Map<String, Object> extensions = ensureExtensions(activity);
    +
    +        addLocationExtension(activity, item);
    +
    +        if(item.getLikes() != null) {
    +            Map<String, Object> likes = new HashMap<String, Object>();
    +            likes.put("count", item.getLikes().getCount());
    +            extensions.put("likes", likes);
    +        }
    +
    +        extensions.put("hashtags", item.getTags());
    +
    +        Image standardResolution = new Image();
    +        if(item.getType() == "image" && item.getImages() != null) {
    +            ImageData standardResolutionData = item.getImages().getStandardResolution();
    +            standardResolution.setHeight((double)standardResolutionData.getImageHeight());
    +            standardResolution.setWidth((double)standardResolutionData.getImageWidth());
    +            standardResolution.setUrl(standardResolutionData.getImageUrl());
    +        } else if(item.getType() == "video" && item.getVideos() != null) {
    +            VideoData standardResolutionData = item.getVideos().getStandardResolution();
    +            standardResolution.setHeight((double)standardResolutionData.getHeight());
    +            standardResolution.setWidth((double)standardResolutionData.getWidth());
    +            standardResolution.setUrl(standardResolutionData.getUrl());
    +        }
    +
    +        extensions.put("image", standardResolution);
    --- End diff --
    
    This would not be an extension, but should be on the object directly.


---
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.
---

[GitHub] incubator-streams pull request: Streams 122

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-streams/pull/49


---
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.
---