Skip to content

Commit

Permalink
facebook: add synthetic #liked-by-XXX fragment to like urls to make t…
Browse files Browse the repository at this point in the history
…hem unique

for snarfed/bridgy#215
  • Loading branch information
snarfed committed Jan 5, 2016
1 parent b318e35 commit 3c9cb3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion granary/facebook.py
Expand Up @@ -1024,7 +1024,7 @@ def post_to_object(self, post, is_comment=False):
if isinstance(likes, dict):
obj['tags'] += [self.postprocess_object({
'id': '%s_liked_by_%s' % (obj['id'], like.get('id')),
'url': url,
'url': url + '#liked-by-%s' % like.get('id'),
'objectType': 'activity',
'verb': 'like',
'object': {'url': url},
Expand Down
6 changes: 3 additions & 3 deletions granary/test/test_facebook.py
Expand Up @@ -331,7 +331,7 @@ def tag_uri(name):
]
LIKE_OBJS = [{ # ActivityStreams
'id': tag_uri('10100176064482163_liked_by_100004'),
'url': 'https://www.facebook.com/212038/posts/10100176064482163',
'url': 'https://www.facebook.com/212038/posts/10100176064482163#liked-by-100004',
'objectType': 'activity',
'verb': 'like',
'object': {'url': 'https://www.facebook.com/212038/posts/10100176064482163'},
Expand All @@ -345,7 +345,7 @@ def tag_uri(name):
},
}, {
'id': tag_uri('10100176064482163_liked_by_683713'),
'url': 'https://www.facebook.com/212038/posts/10100176064482163',
'url': 'https://www.facebook.com/212038/posts/10100176064482163#liked-by-683713',
'objectType': 'activity',
'verb': 'like',
'object': {'url': 'https://www.facebook.com/212038/posts/10100176064482163'},
Expand Down Expand Up @@ -503,7 +503,7 @@ def tag_uri(name):
},
'tags':[{
'id': tag_uri('222_liked_by_666'),
'url': 'https://www.facebook.com/212038/posts/222',
'url': 'https://www.facebook.com/212038/posts/222#liked-by-666',
'object': {'url': 'https://www.facebook.com/212038/posts/222'},
'objectType': 'activity',
'verb': 'like',
Expand Down

0 comments on commit 3c9cb3b

Please sign in to comment.