Skip to content

Commit

Permalink
make our own instagram comment and like permalinks by adding fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
snarfed committed Jul 5, 2014
1 parent 7d7ec40 commit d4a2780
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions instagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def comment_to_object(self, comment, media_id, media_url):
'objectType': 'comment',
'id': self.tag_uri(comment.id),
'inReplyTo': [{'id': self.tag_uri(media_id)}],
'url': media_url,
'url': '%s#comment-%s' % (media_url, comment.id) if media_url else None,
# TODO: add PST time zone
'published': comment.created_at.isoformat('T'),
'content': comment.text,
Expand All @@ -305,7 +305,7 @@ def like_to_object(self, liker, media_id, media_url):
"""
return self.postprocess_object({
'id': self.tag_uri('%s_liked_by_%s' % (media_id, liker.id)),
'url': media_url,
'url': '%s#liked-by-%s' % (media_url, liker.id) if media_url else None,
'objectType': 'activity',
'verb': 'like',
'object': {'url': media_url},
Expand Down
6 changes: 3 additions & 3 deletions instagram_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def tag_uri(name):
'content': '\u592a\u53ef\u7231\u4e86\u3002cute\uff0cvery cute',
'id': tag_uri('789'),
'published': '2012-10-07T05:45:57',
'url': 'http://instagram.com/p/ABC123/',
'url': 'http://instagram.com/p/ABC123/#comment-789',
'inReplyTo': [{'id': tag_uri('123_456')}],
'to': [{'objectType':'group', 'alias':'@public'}],
},
Expand Down Expand Up @@ -199,7 +199,7 @@ def tag_uri(name):
MEDIA_WITH_LIKES.likes = LIKES
LIKE_OBJS = [{ # ActivityStreams
'id': tag_uri('123_456_liked_by_8'),
'url': 'http://instagram.com/p/ABC123/',
'url': 'http://instagram.com/p/ABC123/#liked-by-8',
'objectType': 'activity',
'verb': 'like',
'object': { 'url': 'http://instagram.com/p/ABC123/'},
Expand All @@ -215,7 +215,7 @@ def tag_uri(name):
'content': 'likes this.',
}, {
'id': tag_uri('123_456_liked_by_9'),
'url': 'http://instagram.com/p/ABC123/',
'url': 'http://instagram.com/p/ABC123/#liked-by-9',
'objectType': 'activity',
'verb': 'like',
'object': { 'url': 'http://instagram.com/p/ABC123/'},
Expand Down
2 changes: 1 addition & 1 deletion oauth_dropins
Submodule oauth_dropins updated 1 files
+1 −1 webutil

0 comments on commit d4a2780

Please sign in to comment.