Skip to content

Instantly share code, notes, and snippets.

@dariusk
Last active March 5, 2024 07:31
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dariusk/e0aa9a0b4229c47dec2bc57cc6bb0994 to your computer and use it in GitHub Desktop.
Save dariusk/e0aa9a0b4229c47dec2bc57cc6bb0994 to your computer and use it in GitHub Desktop.

Event - generic ActivityPub

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Event",
  "name": "Movie Night",
  "startTime": "2014-12-31T23:00:00-08:00",
  "endTime": "2015-01-01T06:00:00-08:00"
}

Event - Friendica

From https://libranet.de/display/0b6b25a8-245d-799e-dc21-d46304417171

{
   "@context":[
      "https:\/\/www.w3.org\/ns\/activitystreams",
      "https:\/\/w3id.org\/security\/v1",
      {
         "vcard":"http:\/\/www.w3.org\/2006\/vcard\/ns#",
         "dfrn":"http:\/\/purl.org\/macgirvin\/dfrn\/1.0\/",
         "diaspora":"https:\/\/diasporafoundation.org\/ns\/",
         "litepub":"http:\/\/litepub.social\/ns#",
         "manuallyApprovesFollowers":"as:manuallyApprovesFollowers",
         "sensitive":"as:sensitive",
         "Hashtag":"as:Hashtag",
         "directMessage":"litepub:directMessage"
      }
   ],
   "id":"https:\/\/libranet.de\/objects\/0b6b25a8-245d-799e-dc21-d46304417171",
   "type":"Event",
   "summary":"",
   "inReplyTo":null,
   "diaspora:guid":"0b6b25a8-245d-799e-dc21-d46304417171",
   "published":"2019-09-12T01:26:52Z",
   "url":"https:\/\/libranet.de\/display\/0b6b25a8-245d-799e-dc21-d46304417171",
   "attributedTo":"https:\/\/libranet.de\/profile\/mikem",
   "sensitive":false,
   "context":"https:\/\/libranet.de\/objects\/0b6b25a8-245d-799e-dc21-d46304417171#context",
   "name":"major event",
   "content":"",
   "startTime":"2019-09-12T00:00:00Z",
   "endTime":"2019-09-13T00:00:00Z",
   "source":{
      "content":"[event-summary]major event[\/event-summary][event-start]2019-09-12 00:00:00[\/event-start][event-finish]2019-09-13 00:00:00[\/event-finish]",
      "mediaType":"text\/bbcode"
   },
   "attachment":[

   ],
   "tag":[

   ],
   "to":[
      "https:\/\/www.w3.org\/ns\/activitystreams#Public"
   ],
   "cc":[
      "https:\/\/libranet.de\/followers\/mikem"
   ]
}

Event - Osada

From https://apfed.club/event/1f393985-a298-4ef4-8b67-ec7ff7ec4da8

{
   "@context":[
      "https://www.w3.org/ns/activitystreams",
      "https://w3id.org/security/v1",
      "https://apfed.club/apschema/v1.5"
   ],
   "type":"Event",
   "id":"https://apfed.club/event/1f393985-a298-4ef4-8b67-ec7ff7ec4da8",
   "summary":"importer",
   "startTime":"2019-09-12T04:01:00Z",
   "content":"exporter",
   "location":{
      "type":"Place",
      "content":""
   },
   "source":{
      "content":"[event-summary]importer[/event-summary][event-description]exporter[/event-description][event-start]2019-09-12 04:01:00[/event-start][event-finish]2019-09-12 05:01:00[/event-finish][event-id]1f393985-a298-4ef4-8b67-ec7ff7ec4da8[/event-id][event-adjust]1[/event-adjust]",
      "mediaType":"text/bbcode"
   },
   "url":[
      {
         "mediaType":"text/calendar",
         "href":"https://apfed.club/events/ical/1f393985-a298-4ef4-8b67-ec7ff7ec4da8"
      }
   ],
   "actor":"https://apfed.club/channel/blue",
   "endTime":"2019-09-12T05:01:00Z",
   "signature":{
      "@context":[
         "https://www.w3.org/ns/activitystreams",
         "https://w3id.org/security/v1"
      ],
      "type":"RsaSignature2017",
      "nonce":"9012e9526fb053e83d4be6ca3288f1fb0da01c287952828adfc83bf1a97117f3",
      "creator":"https://apfed.club/channel/blue/public_key_pem",
      "created":"2019-09-13T05:08:15Z",
      "signatureValue":"ZsVkcp4CIwQOelI/wCTaj3NdpuI1qDjuhOJtE+xYVJ2VPUQ2kIJR5sDsOwRxXuxJyjw/dmElamTp+NT8BuEzturfPdGZQTcFQP8wgQOyVkbIm7a+ynEbVUCr7Wmjn0kFApb3hCWwLEHA8VK/tnZiwcp1WlFQpEk1JL00NSq3HTKV4ZiuejjHPjvzQfaT5hcNV/v0/RzYXYJLrwKZ6Fub89wsisMHlj3kVjOZchZv22qIXkqBCjl+kx3iPgaZsTtwAgei/QVXqZocOqHihB2FN06aGT8X9+FzbW+dJRgdG1va0WFi73bOkOgJt+u54wUsl9oNLW0vIcKkKe8Nkxh8uAkNGpn1I1/M5Tlk7LYOk4eSm9PNOzgBpejJxd3dSWYX5eQGSLhAdUPwVbyVmaXJ2GAvg3+QSqbJFdqWsG3kZYSJYh916UEJ2L0G/fWaLiOr7T9n5ZXq6xSkqSYJCfiasNn/+uldYAU/XZrTHaQmzNiL5fVVJSPQBy+mZ3Yid59UlUbmoEMEHfJ3jL5kh3dSwG7bVswaXaRqM/B0rLwXq7eDLi2kkJHODeiuF5mpNV1MdFQFgl+4POzE0XxDejPD04fF9wMY8W+rrulF3xJvAhsrQJ0bYnpvEvSC05Yh9yefusAQGI8NpRNV3DRKgAtCZvFw7c3pyyqe1ORwtLxtLOI="
   }
}

Note - generic ActivityPub

{
	"@context": ["https://www.w3.org/ns/activitystreams"],
	"type": "Note",
	"to": ["https://www.w3.org/ns/activitystreams#Public"],
	"content": "This was sent with my new debugging tool, and it's a small message. "

}

Note - Mastodon

{
	"@context": ["https://www.w3.org/ns/activitystreams", {
		"ostatus": "http://ostatus.org#",
		"atomUri": "ostatus:atomUri",
		"inReplyToAtomUri": "ostatus:inReplyToAtomUri",
		"conversation": "ostatus:conversation",
		"sensitive": "as:sensitive",
		"Hashtag": "as:Hashtag",
		"toot": "http://joinmastodon.org/ns#",
		"Emoji": "toot:Emoji",
		"focalPoint": {
			"@container": "@list",
			"@id": "toot:focalPoint"
		}
	}],
	"id": "https://friend.camp/users/darius/statuses/102005808869517236",
	"type": "Note",
	"summary": null,
	"inReplyTo": null,
	"published": "2019-04-28T20:58:40Z",
	"to": ["https://www.w3.org/ns/activitystreams#Public"],
	"sensitive": false,
	"inReplyToAtomUri": null,
	"conversation": "tag:friend.camp,2019-04-28:objectId=1754000:objectType=Conversation",
	"content": "This was sent with my new debugging tool",
	"attachment": [],
	"tag": []

}

Note - Pixelfed

{
	"@context": ["https:\/\/www.w3.org\/ns\/activitystreams", "https:\/\/w3id.org\/security\/v1", {
		"sc": "http:\/\/schema.org#",
		"Hashtag": "as:Hashtag",
		"sensitive": "as:sensitive",
		"commentsEnabled": "sc:Boolean",
		"capabilities": {
			"announce": {
				"@type": "@id"
			},
			"like": {
				"@type": "@id"
			},
			"reply": {
				"@type": "@id"
			}
		}
	}],
	"type": "Note",
	"summary": null,
	"content": "This is also sent from my tool, it's an Image post in the Pixelfed JSON format",
	"inReplyTo": null,
	"to": ["https:\/\/www.w3.org\/ns\/activitystreams#Public"],
	"sensitive": false,
	"attachment": [{
		"type": "Image",
		"mediaType": "image\/jpeg",
		"url": "https:\/\/pixelfed.social\/storage\/m\/c0a835dce0d3aa48f1ba415896935fed81cfae43\/c32e0da6aa87d60a2a0e90299b737869c0d9a040\/sGYmhP3gVMnx4QsAF5VLnYPN4xF9KRdXu564UCjJ.jpeg",
		"name": "This is also sent from my tool, it's an Image post in the Pixelfed JSON format"
	}],
	"tag": [],
	"commentsEnabled": true,
	"capabilities": {
		"announce": "https:\/\/www.w3.org\/ns\/activitystreams#Public",
		"like": "https:\/\/www.w3.org\/ns\/activitystreams#Public",
		"reply": "https:\/\/www.w3.org\/ns\/activitystreams#Public"
	}
}

Article - Write.As

Contains rich text and inline images, vanilla mastodon should render it as a stub.

{
	"@context": ["https://www.w3.org/ns/activitystreams"],
	"type": "Article",
	"id": "http://27c6f28c.ngrok.io/api/posts/k00igfu4v3",
	"published": "2019-05-03T05:58:26Z",
	"inReplyTo": null,
	"url": "http://27c6f28c.ngrok.io/the-title-of-this-article-type-post",
	"attributedTo": "http://27c6f28c.ngrok.io/api/collections/admin",
	"to": ["https://www.w3.org/ns/activitystreams#Public"],
	"cc": ["http://localhost:3000/users/admin"],
	"name": "The Title of this Article Type Post",
	"content": "\u003ch2 id=\"introduction\"\u003eIntroduction\u003c/h2\u003e\n\n\u003cp\u003eThis is a test of Article posts.\u003c/p\u003e\n\n\u003ch2 id=\"inline-images\"\u003eInline Images\u003c/h2\u003e\n\n\u003cp\u003eHere is an image! It\u0026#39;s cached locally to protect your IP when loading the image.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Bahrain_Fort_March_2015.JPG/1000px-Bahrain_Fort_March_2015.JPG\" alt=\"Even more alt text\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThis next image will fail to load because it\u0026#39;s an HTML file embedded in the \u003ccode\u003e\u0026lt;img src\u0026gt;\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://tinysubversions.com/index.html\" alt=\"You aren\u0026#39;t seeing an image because this is not actually an image. Instead you\u0026#39;re seeing this alt text.\"\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eHooray!\u003c/em\u003e\u003c/p\u003e\n",
	"contentMap": {
		"en": "\u003ch2 id=\"introduction\"\u003eIntroduction\u003c/h2\u003e\n\n\u003cp\u003eThis is a test of Article posts.\u003c/p\u003e\n\n\u003ch2 id=\"inline-images\"\u003eInline Images\u003c/h2\u003e\n\n\u003cp\u003eHere is an image! It\u0026#39;s cached locally to protect your IP when loading the image.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Bahrain_Fort_March_2015.JPG/1000px-Bahrain_Fort_March_2015.JPG\" alt=\"Even more alt text\"\u003e\u003c/p\u003e\n\n\u003cp\u003eThis next image will fail to load because it\u0026#39;s an HTML file embedded in the \u003ccode\u003e\u0026lt;img src\u0026gt;\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003cimg src=\"https://tinysubversions.com/index.html\" alt=\"You aren\u0026#39;t seeing an image because this is not actually an image. Instead you\u0026#39;re seeing this alt text.\"\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cem\u003eHooray!\u003c/em\u003e\u003c/p\u003e\n"
	},
	"tag": []
}

And a Write.as article with bullet point formatting

{"@context":["https://www.w3.org/ns/activitystreams"],"type":"Article","id":"https://write.as/api/posts/vr0oaivg16dva43l","published":"2021-04-23T21:20:40Z","inReplyTo":null,"url":"https://write.as/dfk-test/testing-things","attributedTo":"https://write.as/api/collections/dfk-test","to":["https://www.w3.org/ns/activitystreams#Public"],"cc":["https://write.as/api/collections/dfk-test/followers"],"name":"Testing things","content":"\u003cp\u003eThis is a test.\u003c/p\u003e\n\u003cul\u003e\u003cli\u003ewoo\u003c/li\u003e\n\u003cli\u003eyes it is\u003c/li\u003e\n\u003cli\u003ecertainly a test\n\u003cul\u003e\u003cli\u003ehow about it???\u003c/li\u003e\u003c/ul\u003e\u003c/li\u003e\n\u003cli\u003eyup\u003c/li\u003e\u003c/ul\u003e\n","contentMap":{"en":"\u003cp\u003eThis is a test.\u003c/p\u003e\n\u003cul\u003e\u003cli\u003ewoo\u003c/li\u003e\n\u003cli\u003eyes it is\u003c/li\u003e\n\u003cli\u003ecertainly a test\n\u003cul\u003e\u003cli\u003ehow about it???\u003c/li\u003e\u003c/ul\u003e\u003c/li\u003e\n\u003cli\u003eyup\u003c/li\u003e\u003c/ul\u003e\n"},"tag":[]}

Delete account/profile notice - Mastodon

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "id": "https://mastodon.social/users/somedeletedperson#delete",
  "type": "Delete",
  "actor": "https://mastodon.social/users/somedeletedperson",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "object": "https://mastodon.social/users/somedeletedperson",
  "signature": {
    "type": "RsaSignature2017",
    "creator": "https://mastodon.social/users/somedeletedperson#main-key",
    "created": "2020-01-05T03:06:56Z",
    "signatureValue": "Cky4wIt5uM5y9vMawxxx6Xw5i/gLtPEPiSmSqxMWUeAO9XEWyo6ttD8pESepAirb+ECHjfgZFXpZeDu6WUfAp0MsJ0l+P9fS0NDbtDd1VmF1jQOyKmhXDSWgZBPKDvC4JozTQm3FJtMbyVkecoFYdQeNDUBKolMF8hd7I4TdKm+fUrBLiW4qxUDbsGR+DNWpv0h+mmlbMJfxZRosX0vhUJhUO8MwuGWrqXd+bXPMU27yhMaIPuo//sCWymRGaXkOd67y5adWIuBffmvWJGLcwzdEEjX5PdPvSKNn1Lfa2IfHEi2jMP+zF/PqsqrgtkPYqqttAkIlJIqEKQb6MUtHA=="
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment