RE: https://example.viii.fi/posts/69aeb347-03d0-dc44-83c8-9c7c488ff6e0.json

Thanks for all the suggestions. I've now implemented multiple images.

Next, I'll see if I can support updating or deleting posts.

OK! Posts and their attachments can now be deleted from #ActivityBot.

Source code: https://gitlab.com/edent/activity-bot/

Taking a little break for now, so you get to vote on the next feature:

Upload video (probably easy)
8.3%
Edit posts (probably hard)
20.8%
Set "Content Warning" (probably medium)
70.8%
Something else (leave a comment)
0%
Poll ended at .
Terence Eden / ActivityBot · GitLab

A single PHP file which acts as a basic ActivityPub bot server.

GitLab

OK, for real, why does #Mastodon use an attachment type of "Document" when posting a video?

I think the spec says "Video" is OK to use.
https://www.w3.org/TR/activitystreams-vocabulary/#dfn-video

Or am I misunderstanding something fundamental?

Activity Vocabulary

@Edent Video is a subtype of Document, so it's not really wrong.

@Gargron I defer to your expertise, of course 😄 But wouldn't having Images be of type Image etc be more precise?

I guess a duff server could say something is of type video, but give it a MIME of a static image - so clients should check the media anyway?

@Edent Yes, ultimately it's up to the receiver to figure out how the file type is to be handled. For example, GIFs are converted to MP4 files without sound in Mastodon. Is that an Image or a Video? I'm not sure you'd gain anything from specifying this on the protocol level.
@Gargron ah! That makes sense. Ta 👍

I've added video (and audio) uploads to #ActivityBot. It also now supports content warnings.

For my next trick - edits to existing posts.

Does anyone have a simple #ActivityPub guide showing how an update message is supposed to look & propagate?

https://gitlab.com/edent/activity-bot/

Terence Eden / ActivityBot · GitLab

A single PHP file which acts as a basic ActivityPub bot server.

GitLab

I'm a fucking idiot!

Searched for "ActivityPub Update Example" and one of the first results was…

A blog I wrote two years ago!

https://shkspr.mobi/blog/2024/03/how-updates-work-in-activitypub-mastodon/

How updates work in ActivityPub / Mastodon

I didn't realise this, so I'm documenting it to stop other people making the same silly mistake that I did. Messages in ActivityPub have two distinct ID strings. Here's a (truncated) view of what happens when I send a new message on Mastodon: JSON "id": "https://mastodon.social/users/Edent/statuses/1234567890/activity", "type": "Create", …

Terence Eden’s Blog

Hmph. My updates are being sent, but only *some* #ActivityPub servers are updating the post.

If you fancy telling me which obvious mistake I've made, I've raised an issue at:

https://github.com/mastodon/mastodon/issues/38128

EDIT: Nope. It did work when - guess what - I read the fucking documentation.

Updates not updating on Mastodon, but are accepted on other AP servers · Issue #38128 · mastodon/mastodon

Steps to reproduce the problem My ActivityBot server sent the following update message: { "@context": "https://www.w3.org/ns/activitystreams", "id": "https://example.viii.fi/posts/69b007a4-11a5-03e...

GitHub
@Edent This is my single biggest annoyance with AP: you have to debug your application against every service you want to interact with, and the round-trip debugging loop is loooong.
@Edent
If it helped you make sure to treat the author to a coffee!
@kos mate, I'm gonna be buying him several pints tonight 😉
@Edent @kos not sure that will help with improving their memory.

@Edent No you're not. You wrote that for Future You!

I've lost track of the number of times I've fixed something by searching and finding a mailing list post from me that's 10 years old, fixing the same something.

Thanks, historical me!

@Edent I love it when past-me was on the ball.

@Edent Not just you - once looked for a trail map of Simonside only to find the Forestry Commission was using #OpenStreetMap ... which I'd updated extensively with trail details from my previous walks!

Thanks, historical me!

@Edent I LOVE when this happens. A blog post written in words I understand and the commands probably have the correct paths for my machine as well :)
@Edent Isn't that what (and who) we all write documentation for?
@Edent guess what's going to happen in about 2 years time...
shuttlecraft/lib/ActivityPub.js at main · benbrown/shuttlecraft

a single user activitypub server - join the federation! - benbrown/shuttlecraft

GitHub