#
#TIL Set your Content-Type header correctly when sending #ActivityPub messages. #Lemmy will 404 on any inbox if the header is not correct (actually just if it doesn't start with application/
Personal Blog about anything - mostly programming, cooking and random thoughts
#TIL Set your Content-Type header correctly when sending #ActivityPub messages. #Lemmy will 404 on any inbox if the header is not correct (actually just if it doesn't start with application/
I've worked on some smaller features and improvements for owl-blogs.
Main Features:
For development I took the time to setup the "end-to-end" tests using go test instead of the previous pytest setup. This vastly simplifies testing and its much quicker.
To test #ActivityPub functionality I use a small mock server, which content can be controlled during testing.
Some crawlers try to use the (non-existing) #Mastodon API of my blog, since my blog supports #ActivityPub.
Most don't send a User-Agent or use the generic user-agent of the library they use.
"/api/nodeinfo"
"/api/v1/config"
"/api/v1/directory?limit=1"
"/api/v1/instance"
"/api/v1/instance/activity"
"/api/v1/instance/domain_blocks"
"/api/v1/instance/peers"
"/api/v1/streaming/public"
"/api/v1/timelines/public?limit=100"
"/api/v1/timelines/public?limit=40"
"/api/v3/federated_instances"
A nice and simple solution to add comments to your blog.
I've decided to go the bit more complicated route and added #ActivityPub support to my blog directly. Any interaction will show up below the posts. However this requires a backend and will not work with a static site generator.
Next Milestone for #ActivityPub support in owl-blogs: being able to play fedi-games :D
When using go-ap/jsonld, to extend the context by a term use:
jsonld.WithContext(
jsonld.Context{
{IRI: jsonld.IRI(vocab.ActivityBaseURI)},
{Term: jsonld.Term("Hashtag"), IRI: jsonld.IRI("https://www.w3.org/ns/activitystreams#Hashtag")},
},
)
Instead of:
var ApEncoder = jsonld.WithContext(
jsonld.IRI(vocab.ActivityBaseURI),
jsonld.Context{
{Term: jsonld.Term("Hashtag"), IRI: jsonld.IRI("https://www.w3.org/ns/activitystreams#Hashtag")},
},
)
The latter ignores the terms.
My blog now (hopefully) supports #hashtags on #ActivityPub. Please like this post if you found this via a hashtag.
again testing hashtags with #activitypub #mastodon format.
I'm not sure if this note will show up on hashtags. They are added to the #ActivityPub object, but is this sufficient for #Mastodon?
Please react to this if you saw this note due to its hashtag!
owl-blogs now supports replies to entries. The content of the reply is added to the bottom of the post, similar to comments.