I've added a feature request to #Mastodon to display geotags.
Image upload works! And those photos percolate through the #fediverse!
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 #OSM and #ActivityPub!
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?
@Edent yes. Mastodon is especially interested in telling everybody who closed down their account.
Hmmm. Either I don't understand the #ActivityStreams 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.
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
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.
@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!
That's a bit ambitious for me. But it is what StreetComplete is for.
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.
@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 @sxa
100%!
Mine is just a Proof of Concept. It *can* be done - but needs something bigger & better for real use.
@Edent @edent_location what you’re doing is quite fun! I’m following with interest as I’m curious about implementing something similar 😃
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?
Hmmm. Converting my #ActivityPub posts to #GeoJSON was pretty straightforward.
Here's what a map of my recent check-in activity looks like:
@Edent @edent_location you are trucking! Keep up the mojo
OK, if you'd like to play about with a *very* basic front-end for my Fediverse-location-foursquare-check-in thing, please visit:
SUPER bare-bones. Just a proof of concept.
@Edent haha! This is so cool! This pic raised a proper belly laugh when it showed up on my phone.
Bravo! 👏👏👏👏
Here's my blog post about building a personal #Fediverse server in #PHP.
https://shkspr.mobi/blog/2024/02/a-tiny-incomplete-single-user-write-only-activitypub-server-in-php/
It was surprisingly simple. You can *publish* #ActivityPub with very modest computing resources.
If you can see the geotags on @edent_location please send me a screenshot 🙂
@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}&mlon=${longitude}#map=19/${latitude}/${longitude}`)
@Edent @edent_location This is such a cool project! 👏 I am sure the #OpenStreetMap and #Mapstodon folks are interested in your location sharing project and it could spark more ideas for geo-related use-cases built on top of ActivityPub 🎉
Well, my personal #ActivityPub 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?
@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)
@Edent I'm quite happy it just being a bot, what benefits would there be for running it on its own server?
@okwithmydecay decentralisation. Not taking up resources on someone else's site. To prove it can be done.
That's about it, really.
@OpinionatedGeek @edent_location
Wow! Thanks!
@mattround it me!
@Edent no joke, is was publicly wishing this existed, and the Internet (well… you in this case) delivered. Sweet!
@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.
@derickr probably - only stuck it up quickly!
It is just the standard Symfony one. No other libraries. I'll add it shortly.
@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!
@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.
@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 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.
@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.
@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.
@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.
@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!
@andypiper dead easy 🙂
My first attempt used it - but Glitch doesn't like it when it gets hammered by lots of requests.