Skip to content

Commit 93a64e9

Browse files
committed
Atom: switch to converting AS1 id (instead of url) to Atom id
1 parent cc228f1 commit 93a64e9

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ Changelog
292292
---
293293
### 4.1 - unreleased
294294

295+
* Atom:
296+
* Switch to converting AS1 `id` (instead of `url`) to Atom `id`.
297+
295298
- _Non-breaking changes_
296299

297300
* Twitter
@@ -300,6 +303,7 @@ Changelog
300303
* Facebook
301304
* Scraping: extract post id from `_ft_` query param instead of `story_fbid`, which is now an opaque token that changes regularly. ([facebook-atom#27](https://github.com/snarfed/facebook-atom/issues/27))
302305

306+
303307
### 4.0 - 2022-03-23
304308

305309
_Breaking changes:_

granary/templates/_entry.atom

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{% endif %}
88

99
{% set url = activity.url or obj.url %}
10-
<id>{{ url }}</id>
10+
<id>{{ activity.id or obj.id or url }}</id>
1111
<title>{{ activity.title|safe }}</title>
1212

1313
{% if obj.summary %}

granary/tests/test_atom.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</author>
2020
2121
<activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
22-
<id>https://www.instagram.com/p/ABC123/</id>
22+
<id>tag:instagram.com:123_456</id>
2323
<title>this picture -&gt; is #abc @foo #xyz</title>
2424
<content type="xhtml">
2525
<div xmlns="http://www.w3.org/1999/xhtml">
@@ -80,14 +80,14 @@
8080
INSTAGRAM_ACTIVITY = {
8181
'objectType': 'activity',
8282
'verb': 'post',
83-
'id': 'https://www.instagram.com/p/ABC123/',
83+
'id': 'tag:instagram.com:123_456',
8484
'actor': {
8585
'displayName': 'Ryan B',
8686
'objectType': 'person',
8787
'url': 'https://www.instagram.com/snarfed/',
8888
},
8989
'object': {
90-
'id': 'https://www.instagram.com/p/ABC123/',
90+
'id': 'tag:instagram.com:123_456',
9191
'objectType': 'photo',
9292
'title': 'this picture -> is #abc @foo #xyz',
9393
'content': 'this picture -> is #abc @foo #xyz Le Truc',

granary/tests/test_facebook.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ def tag_uri(name):
982982
983983
<activity:object-type>http://activitystrea.ms/schema/1.0/image</activity:object-type>
984984
985-
<id>https://www.facebook.com/212038/posts/10100176064482163</id>
985+
<id>tag:facebook.com:10100176064482163</id>
986986
<title>Checking another side project off my list. portablecontacts-unofficial is live! &amp;3 Super Happy Block...</title>
987987
988988
<content type="xhtml">

granary/tests/test_instagram.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def tag_uri(name):
415415
416416
<activity:object-type>http://activitystrea.ms/schema/1.0/photo</activity:object-type>
417417
418-
<id>https://www.instagram.com/p/ABC123/</id>
418+
<id>tag:instagram.com:123_456</id>
419419
<title>this picture -&gt; is #abc @foo #xyz</title>
420420
421421
<content type="xhtml">

granary/tests/test_twitter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ def tag_uri(name):
618618
619619
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
620620
621-
<id>https://twitter.com/snarfed_org/status/100</id>
621+
<id>tag:twitter.com:100</id>
622622
<title>@twitter meets @seepicturely at #tcdisrupt &lt;3 first instagr.am/p/MuW67</title>
623623
624624
<content type="xhtml">

0 commit comments

Comments
 (0)