Day 84: Sending h-card Locations in OwnYourGram #100DaysOfIndieWeb

Today I added an option to OwnYourGram to opt in to receiving an h-card as the location property instead of a geo:// URI. On the dashboard, there is a setting to toggle between receiving a geo:// URI with file uploads, and an h-card location with a reference to the Instagram photo URL.

Since Micropub's form-encoded format doesn't support nested objects like h-card, we have to use the JSON format to send that. However in JSON format, we can't upload files, so we need to send just the image URL. Typically, a Micropub client would first upload the photo to the user's Media Endpoint and include the resulting URL in the JSON Micropub request. However since the photo already exists at a URL on Instagram's server, I just skipped the extra upload step and pass the endpoint the Instagram URL.

So if you want to start receiving the location as an h-card, you can opt in to this change on the OwnYourGram dashboard!