Edent,
@Edent@mastodon.social avatar

🆕 blog! “Rebuilding FourSquare for ActivityPub using OpenStreetMap”

I used to like the original FourSquare. The "mayor" stuff was a bit silly, and my friends never left that many reviews, but I loved being able to signal to my friends "I am at this cool museum" or "We're at this pub if you want to meet" or "Spendi…

👀 Read more: https://shkspr.mobi/blog/2024/01/rebuilding-foursquare-for-activitypub-using-openstreetmap/

jupiter_rowland,

@Terence Eden Just FYI: At least Hubzilla has the built-in functionality to add a geographic location to each post, and you can optionally even enter a default location into your channel settings. There's an optional app named OpenStreetMap that can show the post location or any other place in OSM. There's also an optional app named Rendez-vous that can be used to plan meetings using OSM as the map provider.

Both Friendica and (streams) have similar OpenStreetMap add-ons, but they don't have anything like Rendez-vous.

Granted, it all dates back to before Mastodon, so it isn't geared towards working with Mastodon. Also, it isn't built against ActivityPub primarily but against DFRN (Friendica), Zot6 (Mastodon) and Nomad ((streams)). But maybe it's worth checking out.

#Long #LongPost #CWLong #CWLongPost #FediMeta #FediverseMeta #CWFediMeta #CWFediverseMeta #Friendica #Hubzilla #Streams #(streams) #OpenStreetMap

aslakr,
@aslakr@mastodon.social avatar

@Edent used to visualise so called machine tags with osm:way=, e.g. https://www.flickr.com/photos/tags/osm:way=35667218 as described in https://code.flickr.net/2009/09/28/thats-maybe-a-bit-too-dorky-even-for-us/

Somewhere along the line support for it got lost.

john_fisherman,
@john_fisherman@mastodon.social avatar

@Edent heads up! @davidroessli

davidroessli,
@davidroessli@mastodon.social avatar

@john_fisherman @Edent Amazing 🤩 Thankxx

john_fisherman,
@john_fisherman@mastodon.social avatar

@davidroessli @Edent thought you'd like it, yeah! :)

andypiper,
@andypiper@macaw.social avatar

@Edent FWIW I've been working on Postmarks a bit, which also used Darius' Express AP server initially, so may be interested in having a prod here. Plus I share the interest in old 4sq, current OSM, etc. Funny, didn't we talk about this idea (on Mastodon), about a week ago...

andypiper,
@andypiper@macaw.social avatar

@Edent also this would be a great thing to talk about at ... @fediforum

Edent,
@Edent@mastodon.social avatar

@andypiper @fediforum
I'll see if I'm available and try to work up a talk 🙂

tommorris,
@tommorris@mastodon.social avatar

@Edent I've noodled around with trying to write some code to turn all of OSM into a Foursquare-style venues database but haven't had the time.

My rough plan—a script that parses the entire OSM dataset and:

  • filters out the features one wants based on a predicate (pubs, restaurants, public buildings, etc.)
  • flattens ways/relations into points (calculate centroids)
  • emits lat, long, label, OSM type+ID

Stick result in DB (SQLite+SpatiaLite appeals to me), index on coords, query N closest.

jonty,
@jonty@chaos.social avatar
Edent,
@Edent@mastodon.social avatar

@jonty @tommorris interesting, ta!

tommorris,
@tommorris@mastodon.social avatar

@Edent Most of it is a data quality problem in deciding on the predicate to filter the data.

Do you wanna check into an untitled tree or water fountain in your local park? (Filter things without a name?)

What about checking into a whole city or country? Or a particular borough? Or an area that doesn't line up with a governmental/administrative area (Soho, say)? That's a thing people did on 4sq to tell friends they are visiting.

How about the M25? (This place is not a place of honour etc.)

tommorris,
@tommorris@mastodon.social avatar

@Edent (Incidentally, this isn't a "don't do it", it's more a "I've played around with this in the past and you may will encounter fun weird stuff you didn't expect"—but weird stuff is good, please carry on.)

Edent,
@Edent@mastodon.social avatar

@tommorris turtles all the way down, innit?

evan,
@evan@cosocial.ca avatar

@Edent so, I strongly recommend looking at the full Activity Vocabulary. There are several activities specifically for check-ins. I'm excited about this project.

Edent,
@Edent@mastodon.social avatar

@evan Thanks Evan, I really appreciate that!
I've got the bare-bones working. I can now post a location. Let me know if you want to take a look at the account.

evan,
@evan@cosocial.ca avatar

@Edent I'll put it on my list! I've got a deadline for my book on the 31st and I'm trying not to get distracted. I'll check this week. The big thing is: use Arrive for check-ins! And include a summary for servers that don't know what to do with them.

bobwyman,
@bobwyman@mastodon.social avatar

@evan @Edent Unfortunately, the Place object is under-specified. While this doesn't impact most AS/AP users today, humans will soon return to the Moon and when they do, they won't be able to use AS Place objects to check-in or state their current location.

The problem is that AS Place doesn't allow specifying a coordinate system for Lat/Long. Thus, one can't use locations using the Lunar Coordinate System or any non-Earth Planetary Coordinate System.

We should fix this.
https://lunar.gsfc.nasa.gov/library/451-SCI-000958.pdf

evan,
@evan@cosocial.ca avatar

@bobwyman @Edent let's make an extension for lunar Place objects!

bobwyman,
@bobwyman@mastodon.social avatar

@evan @Edent An extension for Lunar Place objects would be unnecessarily specific and would leave unaddressed the need for extensions allowing Place objects to describe locations on Mars, Io, Neptune, etc.

Given that Latitude/Longitude/Altitude is relevant to most celestial bodies, it would be more effective to add to Place objects a field for specifying the Coordinate System that should be used in interpreting the Latitude/Longitude, etc.

evan,
@evan@cosocial.ca avatar

@bobwyman @Edent let's do it!

bekopharm,
@bekopharm@social.tchncs.de avatar

@Edent microformats know this as well. I toyed with this for my blog but finding a reliable map provider (without cookies) turned out to be quite difficult.

I even tried setting up my own tile server for osm one day. The result was: Don't.

kaffeeringe,
@kaffeeringe@social.tchncs.de avatar
Edent,
@Edent@mastodon.social avatar

OK gang! I now have an extremely basic ActivityPub server which can send messages to its follower!

Next steps:

  • Record who is following it.
  • Post to all followers (not just me).
  • Stable URl for posts.
  • Front end for picking locations nearby.
  • About a dozen other things!
mauvedeity,
@mauvedeity@mastodon.social avatar

@Edent is it called “Fivesquare”?

Edent,
@Edent@mastodon.social avatar

@mauvedeity
Only if I want to get sued!

mauvedeity,
@mauvedeity@mastodon.social avatar

@Edent oh, fair point.

kitten_tech,
@kitten_tech@fosstodon.org avatar

@Edent is this best done as a whole new server - creating a separate account to your "main" one for others to follow? I mean, I am sure it has to be because you can't just ask your existing account to publish arbitrary post metadata your client generates, or can't extend your existing client, but should clients/servers be more extensible to allow such experiments? I mean, it's not too hard to extend email like that.

Edent,
@Edent@mastodon.social avatar

@kitten_tech
In an ideal world, my main Mastodon account would let me attach location metadata much like Twitter does.
But, because it doesn't, I'm writing my own server.
It is just me scratching my own itch and proving it can be done.

ianthetechie,
@ianthetechie@fosstodon.org avatar

@Edent <insert owl meme>

Edent,
@Edent@mastodon.social avatar

@ianthetechie you've lost me, sorry!

derickr,
@derickr@phpc.social avatar

@Edent I am just about to attempt to implement this for my blog — I don't suppose this is a library that does this?

Edent,
@Edent@mastodon.social avatar

Nice! My toy server can now:

✅ Record who is following it.
✅ Post to multiple inboxes.
✅ Generate a permalink for its posts.

It doesn't do:
❌ Signature verification
❌ Handling replies, likes, or unfollows (it is a read-only account)
❌ Showing number of followers, posts, etc.

Pretty happy with that.
Next step - a UI so I can actually send custom posts.

Edent,
@Edent@mastodon.social avatar

Not the prettiest page on the web, but I can now Geolocate my phone and find the 25 nearest named places on .

Next stage is making a button to send that location to my ActivityPub server to send out a message.

(This is crappy code, poorly architected. Just a Proof of Concept.)

Edent,
@Edent@mastodon.social avatar

I've just reposted a public status from my new location check-in service.

It doesn't handle replies or likes, but you can follow it.

Expect buggy and untested weirdness 🙂

alyn,
@alyn@wandering.shop avatar

@Edent
I've tried following from Mastodon and IceShrimp instances just to see if there's a difference.

Edent,
@Edent@mastodon.social avatar

@alyn oooh! I can see both requests. Do let me know what you find. Ta!

alyn,
@alyn@wandering.shop avatar

@Edent Knowing you can't see likes or replies on the location posts, let me report that both my accounts can see photos and parse the alt-text correctly.
It appears neither can handle the location in the way you intend though. I'll use your form of words from the Mastodon Issue to pop one on the repo if that's OK.

Edent,
@Edent@mastodon.social avatar

@alyn
Brilliant, thanks.

Edent,
@Edent@mastodon.social avatar

It's all working!

You can follow @edent_location for my "FourSquare-style" check-ins to locations.

TODO:

📸 Upload and store photos.
🔣 Set the language text to prevent spurious "Translate" options.
🖼 Make the interface look nice.
🔒 Better security
👨‍💻 Tidy up the source code.

Gargron,
@Gargron@mastodon.social avatar

@Edent TODO for us: Display the location metadata when it's provided 😅

Edent,
@Edent@mastodon.social avatar

@Gargron 🥰

Yes please!

Edent,
@Edent@mastodon.social avatar

I've added a feature request to to display geotags.

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

Edent,
@Edent@mastodon.social avatar

Image upload works! And those photos percolate through the !

I still need to add proper alt text (just a static description for now).

And the UI is 💩

But I'm pretty pleased with how far I've got in a few hours of hacking away.

It is totally possible to build a location-based service on top of and !

simonzerafa,

@Edent

Perhaps we could associate a three or four word identifier to each location or just use Four King Maps 😉

https://www.fourkingmaps.co.uk/

Edent,
@Edent@mastodon.social avatar

Goodness me! The ActivityPub network is chatty.
In the last 6 hours, I've received 371 different messages to my single-user inbox.

Most of which seem to be from servers announcing users have been deleted. They're not users or servers I've seen before.

Is this normal?

JSON code showing a user has been deleted.

Gargron,
@Gargron@mastodon.social avatar

@Edent Yes

Edent,
@Edent@mastodon.social avatar

@Gargron haha! Fair enough.

Edent, (edited )
@Edent@mastodon.social avatar

Hmmm. Either I don't understand the spec, or Mastodon doesn't.

According to:
https://www.w3.org/TR/activitystreams-core/#defaultlangcontext

I should be able to specify the language in the @ context. Might have to go for the slightly more verbose contentMap instead.

Edent,
@Edent@mastodon.social avatar

I've built an ersatz FourSquare clone for the Fediverse!

For now it is single user instance (me) and runs on a simple server with no database - just a couple of PHP files.

It geolocates my phone's web browser, shows nearby Points of Interest using OpenStreetMap, lets me attach a short message & an image with alt text.

Then it posts it to its Fediverse followers. The post contains geotags which some ActivityPub clients can see.

Sample post:
https://location.edent.tel/posts/65b8f590-f308-d472-82c5-92a9f227c641.json

Follow: @edent_location

Edent,
@Edent@mastodon.social avatar

Source code is at https://github.com/edent/location-activitypub-symfony

Very much a Minimum Viable Product. Will blog about how it works this weekend.

andypiper,
@andypiper@macaw.social avatar

@Edent 👀 I'm going to have to learn Symfony now... About time I suppose...

Edent,
@Edent@mastodon.social avatar

@andypiper TBH, you don't need to. I just used it as default because it is what I use for OpenBenches.

As long as you can do a rewrite so /inbox hits a PHP file, you can do it in vanilla.

andypiper,
@andypiper@macaw.social avatar

@Edent I wonder how easy it would be to run on something like Glitch... When I am not juggling State of Open and FOSDEM prep I shall take a look!

Edent,
@Edent@mastodon.social avatar

@andypiper dead easy 🙂

My first attempt used it - but Glitch doesn't like it when it gets hammered by lots of requests.

andypiper,
@andypiper@macaw.social avatar

@Edent I have both Postmarks and Shuttlecraft instances on Glitch with low traffic…

andypiper,
@andypiper@macaw.social avatar

@Edent gah, must stop distracting my brain. Next week!

Edent,
@Edent@mastodon.social avatar

@andypiper here's the one I was using, remixed with some location stuff in it.
https://glitch.com/edit/#!/unmarred-ten-approach

derickr,
@derickr@phpc.social avatar

@Edent Are you missing the composer.json file in there?

Edent,
@Edent@mastodon.social avatar

@derickr probably - only stuck it up quickly!
It is just the standard Symfony one. No other libraries. I'll add it shortly.

derickr,
@derickr@phpc.social avatar

@Edent Ah, I was hoping you'd used a library for activity pub. I have been looking at https://github.com/landrok/activitypub and it seems all bogglingly complicated!

Edent,
@Edent@mastodon.social avatar

@derickr I built it by hand by copying https://rknight.me/blog/building-an-activitypub-server/

It is relatively straightforward if all you want to to do is write content.

Happy to talk you through what I did.

derickr,
@derickr@phpc.social avatar

@Edent I had found that link — but was hoping that the PHP world could coalesce around a single library, so that it would be an easy drop in for many many projects (including my own blogs etc).

Edent,
@Edent@mastodon.social avatar

@derickr
Well done on volunteering to write it 😆

derickr,
@derickr@phpc.social avatar
derickr,
@derickr@phpc.social avatar

@Edent I'm going through that, but I am running into some problems. How did you debug this?

For instance, I get a 500 in the UI when I add "derick@social.derickrethans.nl" to the masto search box, but I can see it requesting /@derickr/following and /@derickr/followers in my log.

Edent,
@Edent@mastodon.social avatar

@derickr
I find that search is a bit iffy if it hasn't seen the account before.
But if I visit it directly, it works.

derickr,
@derickr@phpc.social avatar

@Edent Ah, right. I found why the bio didn't work either. I had used the wrong date format (typo: 2024-01-03117:09:00Z instead of 2024-01-31T17:09:00Z)!

Now it has kitten images and a bio and the search works too.

Edent,
@Edent@mastodon.social avatar

Yesterday I went out into the real world and used my self-built FourSquare-forFediverse clone for the first time!

You can see the results by following @edent_location

✅ Location metadata attached
✅ Images with alt text
✅ Links to OSM

❌ No parsing of URls or Hashtags
❌ Location accuracy still a bit dodgy
❌ UI very bare-bones

Pretty good result for half-a-dozen PHP files.

bernat,
@bernat@social.ei8fdb.org avatar

@Edent @edent_location

It certainly does work. There was one thing I noticed that seemed b0rked. That or maybe my client couldn't read it?

I see the alt text in the location.edent link, but when I try to click the alt text link in my (stock Mastodon web client) it doesn't show. See video:
https://saneux.ei8fdb.org/s/MKZqAwjRbM3P8pE

I expected the alt text to be visible in my client, right? Maybe not?

Edent,
@Edent@mastodon.social avatar

@bernat
Interesting. Do you usually see alt text in the web interface?

Edent,
@Edent@mastodon.social avatar

Hmmm. Converting my posts to was pretty straightforward.

Here's what a map of my recent check-in activity looks like:

Edent,
@Edent@mastodon.social avatar

OK, if you'd like to play about with a very basic front-end for my Fediverse-location-foursquare-check-in thing, please visit:

https://location.edent.tel/

SUPER bare-bones. Just a proof of concept.

mrchrisadams,
@mrchrisadams@mastodon.social avatar

@Edent haha! This is so cool! This pic raised a proper belly laugh when it showed up on my phone.

Bravo! 👏👏👏👏

mrchrisadams,
@mrchrisadams@mastodon.social avatar

@Edent no joke, is was publicly wishing this existed, and the Internet (well… you in this case) delivered. Sweet!

https://mastodon.social/@mrchrisadams/110900228246617254

Edent,
@Edent@mastodon.social avatar

@mrchrisadams wooo!

Like I say, super bare bones at the moment. Code is open if you want to run your own version.

In an ideal world, this wouldn't be a separate service but native to Mastodon.

mattround,
@mattround@crispsandwi.ch avatar

@Edent Alternative branding

Edent,
@Edent@mastodon.social avatar

@mattround it me!

Edent,
@Edent@mastodon.social avatar

Here's my blog post about building a personal server in .

https://shkspr.mobi/blog/2024/02/a-tiny-incomplete-single-user-write-only-activitypub-server-in-php/

It was surprisingly simple. You can publish with very modest computing resources.

If you can see the geotags on @edent_location please send me a screenshot 🙂

djh,
@djh@chaos.social avatar

@Edent @edent_location This is such a cool project! 👏 I am sure the and folks are interested in your location sharing project and it could spark more ideas for geo-related use-cases built on top of ActivityPub 🎉

OpinionatedGeek,
@OpinionatedGeek@mastodon.social avatar

@Edent @edent_location Howdy. I'm writing an ActivityPub C2S client web app, so I used your location notes to prototype a tag in my UI. Here's what it currently looks like. (Not sure I like showing the co-ordinates - I may hide them in future. Also, the tag is a clickable link that goes to <https://www.openstreetmap.org/?mlat=>${latitude}&amp;mlon=${longitude}#map=19/${latitude}/${longitude})

Edent,
@Edent@mastodon.social avatar
liaizon,
@liaizon@wake.st avatar

@OpinionatedGeek @Edent @edent_location wow this is so great. Are you also supporting location attached to @pixelfed posts and location data attached to / posts?

OpinionatedGeek,
@OpinionatedGeek@mastodon.social avatar

@liaizon @Edent @edent_location @pixelfed I have no idea! If they use the same ActivityPub location format then yes, it should work, but I haven't tried. If you can send me a few links to posts that you're interested in, I'll check them out and let you know the results.

(It's very early stages for this client, so don't get your hopes up too much. And despite C2S being a standard, it's kindof incomplete as far as a useful implementation goes so I've had to make a bunch of assumptions.)

liaizon,
@liaizon@wake.st avatar

@OpinionatedGeek @Edent @edent_location

you can see an example @pixelfed post that has a location attached here: https://pixelfed.social/p/wakest/496474436686568088

and an example of a @streams post by @mikedev with a location attached here: https://fediversity.site/item/417ff60d-4c9b-4c1e-87dc-831868bcb3de

OpinionatedGeek,
@OpinionatedGeek@mastodon.social avatar

@liaizon @Edent @edent_location @pixelfed @streams @mikedev Ooh - thanks for that! It really made it easy to check.

Here's how they look. Mostly successful! The location appears as it should, and I didn't have to change/fix any code for it. There's some obvious problem with cropping in the second screenshot - no idea what's going on there, but I'll investigate. As I said, the code is still very incomplete.

Thanks for the additional testdata!

A screenshot of wakest's post that is mostly cut off because my client code is showing much too big a preview. The screenshot does show some of the image, along with a location tag saying 'Bugger All, Australia' along with the latitude and longitude.

liaizon,
@liaizon@wake.st avatar

@OpinionatedGeek @Edent @edent_location @pixelfed @streams @mikedev wow that's so awesome it already worked! I will look around to see if there are some other fedi stuff that I can find with location attached. Do you have a name for your client yet?

Edent,
@Edent@mastodon.social avatar

Well, my personal server seems to mostly work!

I wonder if I could move @openbenches from a bot account onto its own server?

Do you prefer post-only bots (which can't reply to you) to be on a bigger instance or run from their own server?

okwithmydecay,
@okwithmydecay@en.osm.town avatar

@Edent I'm quite happy it just being a bot, what benefits would there be for running it on its own server?

Edent,
@Edent@mastodon.social avatar

@okwithmydecay decentralisation. Not taking up resources on someone else's site. To prove it can be done.

That's about it, really.

ahnlak,
@ahnlak@kavlak.uk avatar

@Edent @openbenches my instinct is that bots would definitely benefit from the "authentication" benefits of being on the same domain as they claim to bot for, if that makes sense.

(i.e. if the openbenches bot is on an openbenches.org server, there's not doubt it's the legit bot)

nickchuckwalter,
@nickchuckwalter@mastodon.social avatar

@Edent @edent_location you are trucking! Keep up the mojo

sxa,
@sxa@fosstodon.org avatar

@Edent I missed this post from at the time but @andypiper (as one of the few people I'm still connected with on foursquare/swarm) mentioned it to me at FOSDEM. I always thought it would be nice (and not overly complicated) to have an OSS equivalent so good to see someone's on it :-)
Now I just need to find some time to play with it!

andypiper,
@andypiper@macaw.social avatar

@sxa @Edent I'd definitely like to see whether we can make a more complete project here - this is a fantastic starting point.

Edent,
@Edent@mastodon.social avatar

@andypiper @sxa
100%!
Mine is just a Proof of Concept. It can be done - but needs something bigger & better for real use.

milh0use,

@Edent @edent_location now if you could just add functionality to add/update places in OSM for the inevitable scenario where the list of places you get back is out of date!

Edent,
@Edent@mastodon.social avatar

@milh0use @edent_location

That's a bit ambitious for me. But it is what StreetComplete is for.

andypiper,
@andypiper@macaw.social avatar

@Edent this is pretty much all my Postmarks server gets, too.

andreagrandi,

@Edent thanks for whatever you are doing! It looks cool 🙂

hall,

@Edent a man after my own heart 😜 https://hall.micro.blog/map/

Edent,
@Edent@mastodon.social avatar

@hall nice!

hall,
Edent,
@Edent@mastodon.social avatar

@hall very cool.

silverpill,
@silverpill@mitra.social avatar

@Edent This actor doesn't have the outbox property, which is required by ActivityPub standard

https://www.w3.org/TR/activitypub/#actor-objects

Edent,
@Edent@mastodon.social avatar

@silverpill good point. I'll try to implement that tonight.

mikedev,

It's pretty bare-bones and experimental at the moment - as described earlier in the thread. I haven't seen any activities either, but I suspect if any were sent out that they might not have been signed and possibly rejected - and my logs rotate pretty quickly so I might not have any trace of them either.

I'd also send back one of our own check-in activities, but I don't think the inbox is working yet and @Terence Eden 's Mastodon account won't display them anyway.

No worries. I'm pretty forgiving of works in progress...

Edent,
@Edent@mastodon.social avatar

@mikedev @silverpill
Yeah, it is a "write only" account. It sends messages which seem to be federated out.
I'm logging likes, boosts, and replies, but not doing anything with them yet.
Thanks 🙂

Edent,
@Edent@mastodon.social avatar

@mikedev @silverpill

I've now got a basic outbox at https://location.edent.tel/outbox
Do please let me know if it is broken in some way. Ta!

silverpill,
@silverpill@mitra.social avatar

@Edent @mikedev The orderedItems array of this collection contains Note objects, but it should contain activities (Create-Note activities perhaps?).

See here: https://www.w3.org/TR/activitypub/#outbox

>The outbox stream contains activities the user has published, subject to the ability of the requestor to retrieve the activity ...

The endpoint could actually return 404, or an empty collection. As far as I know it is not mandatory, only outbox actor property is.

mikedev,

This touches on one of my pet peeves. The correct type to use for the activity is Arrive; but this isn't supposed to have an object according to the specs - only a Place as a target.

I think this is short-sighted and doesn't work well for the fediverse. So our checkin activities are

type: Arrive
object: Note
target: Place

We will also accept

type: Arrive
target: Place

but in my opinion this is mostly useless. If you attach a photo or describe what you're doing, these would have to be attached to the Place and that just feels wrong. A Place isn't a Note or an Image or part of a conversation. It's just a Place.

@Terence Eden @Evan Prodromou

mariusor,
@mariusor@metalhead.club avatar

@mikedev I can't understand why you consider the need for a Note as an object, the Arrive activity itself is an object that can contain whatever the Note would contain. In my opinion it's fine to treat activities as contentfull objects.

@silverpill

mikedev,

Wait until you need to "Like" an Arrive. Sure it's easy. Just like it. Except everywhere else in your code you're liking an object and now you're liking an activity containing a target. Now assume somebody sends you one of these Like/Arrive/object:null/target:Place activities. Parse it. Go ahead. I'll wait. It's OK if you take some acid. Anybody reading your code a year from now will need to.

The advantage of having a Note object associated is that any fediverse in existence can render it and display it without even caring that it's an Arrive activity. If they do understand Arrive, they can look at the target and add a map. Done. People can Like it and every ActivityPub developer doesn't have to take acid and build a special parser to handle this weird edge case that's forbidden to have an object. Why do you think that only 3 people in the fediverse have even attempted Check-in activities after 6 years?

mariusor,
@mariusor@metalhead.club avatar

@mikedev I'm confident that there's not going to be any issue.

None of the objects require special casing when it comes to parsing or applying side effects on them (as adding a Like to it's likes collection) Shrug.

I might eat my words if presented with the real life of such an Activity, but until then I am confident. :D /Flexes bicep

mariusor,
@mariusor@metalhead.club avatar

@mikedev actually no, I do have an example already.

Check the moderation queue on brutalinks: https://brutalinks.tech/moderation

Each of the "Reasons" in the listing represents the content on a "Flag"/"Block" activity.

mikedev,

Allow me to re-phrase what I've said, since we have different goals in life. An Arrive activity, as specified in the ActivityStreams vocabulary, is not expected to have an 'object' - only a 'target'. I'm not asking you to provide Arrive activities with an attached Note object. All I'm asking of you is that if you see an Arrive activity and it has a non-null object and you aren't sure what to do with it, is simply to ignore the unexpected object and proceed as if it wasn't there. It has no relevance to you. As opposed to crashing, throwing exceptions, and/or name calling. You should still be able to process and render the Arrive activity just fine - if your software is otherwise equipped to process and render Arrive activities.

mariusor,
@mariusor@metalhead.club avatar

@mikedev I agree: the robustness principle should most definitely apply to receiving ActivityPub objects.

However, I don't see any clear counterargument against moving whatever content the note would contain into the Arrive activity itself. I find an Arrive->Brussels with a content of "Finally made it!" perfectly valid. The note would be redundant, because the meaning of the text is intrinsically linked to the activity and would lack context if it would be in a separate note in the object.

Edent,
@Edent@mastodon.social avatar

@silverpill thanks - I think I've fixed that now.

ni_nad,

@Edent I'm hooked, waiting for the next post! (no pressure on the timing though). I'm new to the OSM space, so Overpass didn't make sense for quite some time, till I searched for it online.

Floppy,
@Floppy@mastodon.me.uk avatar

@Edent this is a very cool idea, and I'm looking at doing some ActivityPub work soon for @manyfold, ideally as a reusable thing that I could plug into Rails somehow. What stack were you thinking of building in?

Edent,
@Edent@mastodon.social avatar

@Floppy @manyfold
Currently building on Symfony because that's what I know best.
I have the basics up and running, but the signature stuff is driving me potty!

Floppy,
@Floppy@mastodon.me.uk avatar

@Edent nice; I know no Symfony, and my PHP is very rusty, but I'd be interested in taking a look at it at least!

lewis,
@lewis@social.lol avatar

@Edent @Floppy @manyfold @robb wrote a blog post on implementing his own ActivityPub server in PHP (https://rknight.me/blog/building-an-activitypub-server/) - it includes a section on validating the signatures, because I think it was a major pain in the arse for him too (source code: https://github.com/rknightuk/bugle/blob/main/app/Services/HttpSignature.php)

robb,
@robb@social.lol avatar

@lewis @Edent @Floppy @manyfold Correct, it was in fact a huge pain to work out.

Edent,
@Edent@mastodon.social avatar

@robb @lewis @Floppy @manyfold
I have "borrowed" a lot of that code for mine 😄
Rob's work is excellent. It is my debugging skills which are poor

Edent,
@Edent@mastodon.social avatar

@robb I don't suppose you came across the error "found an invalid character in header name"?
I'm trying to send an "accept" to a follow request using your code - but something isn't happy.

robb,
@robb@social.lol avatar

@Edent I don’t recall that error, no sorry. This part is a such a pain. If you have your code up somewhere I’d be happy to take a look just as a second pair of eyes.

Edent,
@Edent@mastodon.social avatar
Edent,
@Edent@mastodon.social avatar

@robb ah, I stuffed up the headers. Got them working now.

New error is "Verification failed for ..." Which at least is progress!

robb,
@robb@social.lol avatar

@Edent Excellent! (Was putting the kid to bed and only just started looking, glad you got it sorted)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • fediverse
  • ngwrru68w68
  • DreamBathrooms
  • modclub
  • GTA5RPClips
  • InstantRegret
  • magazineikmin
  • Youngstown
  • thenastyranch
  • rosin
  • slotface
  • mdbf
  • khanakhh
  • kavyap
  • anitta
  • tester
  • normalnudes
  • Leos
  • cisconetworking
  • osvaldo12
  • everett
  • Durango
  • tacticalgear
  • provamag3
  • megavids
  • ethstaker
  • cubers
  • JUstTest
  • lostlight
  • All magazines