Use Activity Streams API for GNU Social #378
One problem with the current JSON activity stream support in GNU Social is that it doesn't have an equivalent of |
Also, I don't believe ActivityStreams 2.0 is supported by GNU Social. That standard is still very much under development by the W3C Social WG. For the short term solution it may be better to, as you said, figure out what would be needed to support AndStatus. I get the feeling looking at the existing code that the use cases considered are mostly GS Classic and Qvitter, both of which can be assumed to operate with permanent and reasonably fast internet access. AndStatus and other mobile clients cannot make that assumption. |
I've been reading the code of GNU Social and it looks like it does pass the information needed to reconstruct the mentions, just not where I initially looked for it. The "to": [
{
"objectType": "http://activitystrea.ms/schema/1.0/person",
"id": "https://community.highlandarrow.com/user/500"
},
{
"objectType": "http://activitystrea.ms/schema/1.0/person",
"id": "https://social.umeahackerspace.se/user/2"
},
{
"objectType": "http://activitystrea.ms/schema/1.0/person",
"id": "https://loadaverage.org/user/339282"
},
{
"objectType": "http://activitystrea.ms/schema/1.0/collection",
"id": "http://activityschema.org/collection/public"
}
], Together with the sender of the message the persons in that list seem to be the ones who should be mentioned. I believe groups can be in the list as well. This still leaves a need to correlate uri's with account names, but at least the raw info is there. |
For reference here's an activity stream file with single but modestly complex entry: {
"generator": "GNU social 1.2.0-beta4",
"title": "verius and friends",
"totalItems": 20,
"items": [
{
"actor": {
"id": "https://loadaverage.org/user/5263",
"displayName": "AndStatus",
"status_net": {
"avatarLinks": [
{
"url": "https://community.highlandarrow.com/avatar/501-original-20160301063016.png",
"rel": "avatar",
"type": "image/png",
"width": 96,
"height": 96
},
{
"url": "https://community.highlandarrow.com/avatar/501-original-20160301063016.png",
"rel": "avatar",
"type": "image/png",
"width": 96,
"height": 96
},
{
"url": "https://community.highlandarrow.com/avatar/501-48-20160301070109.png",
"rel": "avatar",
"type": "image/png",
"width": 48,
"height": 48
},
{
"url": "https://community.highlandarrow.com/avatar/501-24-20160301170752.png",
"rel": "avatar",
"type": "image/png",
"width": 24,
"height": 24
}
],
"profile_info": {
"local_id": "501"
}
},
"image": {
"url": "https://community.highlandarrow.com/avatar/501-original-20160301063016.png",
"rel": "avatar",
"type": "image/png",
"width": 96,
"height": 96
},
"objectType": "person",
"summary": "This is the main posting account of AndStatus - an Open Source low traffic social networking client for Android with tree-like threaded conversations. It supports multiple protocols, including GNU social (\"StatusNet\". e.g. Quitter, LoadAverage, Vinilox, etc.), Twitter and Pump.io. AndStatus can combine your accounts from all networks into one Timeline, and it allows you to read and post even when you are offline.",
"url": "https://loadaverage.org/andstatus",
"location": {
"objectType": "place",
"position": "+25.09538+55.16171/",
"lat": "25.09538",
"lon": "55.16171"
},
"portablecontacts_net": {
"preferredUsername": "andstatus",
"displayName": "AndStatus",
"note": "This is the main posting account of AndStatus - an Open Source low traffic social networking client for Android with tree-like threaded conversations. It supports multiple protocols, including GNU social (\"StatusNet\". e.g. Quitter, LoadAverage, Vinilox, etc.), Twitter and Pump.io. AndStatus can combine your accounts from all networks into one Timeline, and it allows you to read and post even when you are offline.",
"addresses": {
"formatted": "Internet"
},
"urls": [
{
"type": "homepage",
"value": "https://github.com/andstatus/andstatus/wiki",
"primary": "true"
}
]
}
},
"content": "@<a href=\"https://community.highlandarrow.com/user/500\" class=\"h-card mention\">verius</a> Thank you for investigation, could you for transparency and deeper analysis post the json file (in Activity Streams format) under discussion to this new ticket: <br /><a href=\"https://github.com/andstatus/andstatus/issues/359\" title=\"https://github.com/andstatus/andstatus/issues/359\" class=\"attachment\" rel=\"nofollow\">https://github.com/andstatus/andstatus/issues/359</a> \"Use Activity Streams API for GNU Social\" - I created it for us in order to have a common place for discussion and stop going in circles with the same questions...<br /><br /> @<a href=\"https://social.umeahackerspace.se/user/2\" class=\"h-card mention\">mmn</a>",
"generator": {
"id": "tag:status.net,2009:notice-source:ostatus",
"objectType": "application",
"status_net": {
"source_code": "ostatus"
}
},
"id": "tag:loadaverage.org,2016-04-30:noticeId=7985640:objectType=comment",
"object": {
"id": "tag:loadaverage.org,2016-04-30:noticeId=7985640:objectType=comment",
"objectType": "comment",
"content": "@<a href=\"https://community.highlandarrow.com/user/500\" class=\"h-card mention\">verius</a> Thank you for investigation, could you for transparency and deeper analysis post the json file (in Activity Streams format) under discussion to this new ticket: <br /><a href=\"https://github.com/andstatus/andstatus/issues/359\" title=\"https://github.com/andstatus/andstatus/issues/359\" class=\"attachment\" rel=\"nofollow\">https://github.com/andstatus/andstatus/issues/359</a> \"Use Activity Streams API for GNU Social\" - I created it for us in order to have a common place for discussion and stop going in circles with the same questions...<br /><br /> @<a href=\"https://social.umeahackerspace.se/user/2\" class=\"h-card mention\">mmn</a>",
"url": "https://loadaverage.org/notice/7985640",
"status_net": {
"notice_id": 101888
},
"inReplyTo": {
"objectType": "note",
"id": "tag:community.highlandarrow.com,2016-04-30:noticeId=101854:objectType=note",
"url": "https://community.highlandarrow.com/notice/101854"
}
},
"location": {
"objectType": "place",
"position": "+25.09538+55.16171/",
"lat": "25.0953800",
"lon": "55.1617100"
},
"to": [
{
"objectType": "http://activitystrea.ms/schema/1.0/person",
"id": "https://community.highlandarrow.com/user/500"
},
{
"objectType": "http://activitystrea.ms/schema/1.0/person",
"id": "https://social.umeahackerspace.se/user/2"
},
{
"objectType": "http://activitystrea.ms/schema/1.0/person",
"id": "https://loadaverage.org/user/339282"
},
{
"objectType": "http://activitystrea.ms/schema/1.0/collection",
"id": "http://activityschema.org/collection/public"
}
],
"status_net": {
"conversation": "tag:gs.kawa-kun.com,2016-04-28:objectType=thread:nonce=812f03a7bf6a375a",
"notice_info": {
"local_id": "101888",
"source": "ostatus"
}
},
"published": "2016-04-30T10:02:03+00:00",
"provider": {
"objectType": "service",
"displayName": "Highland Arrow Community",
"url": "https://community.highlandarrow.com/"
},
"verb": "post",
"url": "https://loadaverage.org/notice/7985640"
}
]
} |
@VeriusLambda See my comments/questions: C1. What exactly URL did you use to get that response , and how did you authenticate to get it? - I want to capture the whole file (the whole conversation, if it's possible...) for the test case of our future implementation. I suppose you got it from your instance "provider/service" https://community.highlandarrow.com/ ?! Regarding implementation: C2. I think we should implement this as ONE "GNU Social federation" Social Network for all possible accounts on different hosts (just like Pump.io is implemented). Thus we will avoid any duplicated users and messages, no matter from which GNU Social instance they were downloaded. C3. Unlike Pump.io implementation in AndStatus we (possibly) will need to include additional configuration information for each host, when we have GNU Social account (because de facto today different GNU Social hosts are configured differently...). Or actually configuration is the same and WebfingerId like "andtatus@loadaverage.org" plus user's password give all information needed to connect to that host? |
URL: If you have a GNU Social instance you can click on the classic Configuration: In theory that's what webfinger is for. E.g. I would say that the webfinger should point to enough information to get On Sat, Apr 30, 2016 at 3:16 PM, Yuri Volkov notifications@github.com
|
Aha, got it. Do you know how to retrieve the whole Conversation? |
It seems the activity streams output doesn't have that, even though the atom does. For example https://community.highlandarrow.com/api/statuses/friends_timeline/verius.atom has as child of an entry tag Unfortunately that href goes to the HTML version, not to the JSON. Still, it means GNU Social has the information needed, it just doesn't pass it on to the client. |
We had a lot of discussions on why "Twitter Compatible API" is bad and doesn't support federative nature of the GNU Social.
See https://loadaverage.org/conversation/7583424 and https://loadaverage.org/conversation/7740640#notice-7982542
Meanwhile:
It looks like no GNU Social client application uses Activity Streams JSON format to connect to GNU Social yet. So maybe this doesn't work at all now, or is implemented wrong...
Anyway we should try, uncover what is good and what should be done by GNU Social developers to allow AndStatus migration from "Twitter compatible API" to "Activity Streams".