Open manton opened 4 years ago
Based on the discussion from the Micropub popup session, this should be updated to use a filter
parameter. Also, if no filter
is specified, a server may return all contacts, but multi-user platforms could return an empty list (or some other partial list of users).
My Micropub endpoint now supports this!
?q=contact&filter=manton
{
"contacts": [
{
"name": "Manton Reece",
"nickname": "manton",
"photo": "https://aaronparecki.com/2018/09/03/14/photo.jpg",
"url": "https://manton.org"
}
]
}
Internally, it's actually sorting the list based on the frequency that I've interacted with the person. So typing just "m" turns up a list of a bunch of people with @manton at the top.
I'm not sold on the name _internal_url
, and I'm also not expecting to edit my contacts from an app just yet, so I'm holding off on including that URL for now.
Micro.blog now supports this. Identical response as what @aaronpk posted: name
, nickname
, photo
, and url
. Because Micro.blog currently searches all users, it requires filter
to be present and have at least 3 characters. I may tweak this to only search users you're following for shorter length filters.
What's the reasoning behind this not using proper h-card
json?
Seems a bit strange to have posts return full mf2 json but not contacts.
But on the other hand the simpler format is definitely much easier to use.
Probably omitted for simplicity. I'd rather have contacts return MF2, but, alas, major implementations already expect something else. One could add MF2 type and properties though, and leave other stuff there for backwards compatibility.
I've had support for this since 2020-05-10, with the ability to store silo usernames to support @-mentioning on silos:
GET https://www-api.jvt.me/micropub?q=contact
{"contacts":[...,{"name":"Aaron Parecki","nickname":"aaronparecki.com","url":"https://aaronparecki.com/","silos":{"twitter":"aaronpk"},"_internal_url":"https://www.jvt.me/contacts/aaronparecki.com/"}]
(Originally published at: https://www.jvt.me/mf2/2021/02/n0lhc/)
I'm open to both allowing MF2+JSON and JF2-esque formatting here (mainly, so I can return all the fields for my contacts). Is there any issue with people considering something like https://github.com/indieweb/webmention-ecosystem/issues/1 with it defaulting to jf2 to keep backward compatibility? Koype will be implementing it such that it returns MF2+JSON by default (that's how information is stored) but will default to this JF2 payload.
(Originally published at: https://jacky.wtf/2022/6/i0VR)
Copying this here from the wiki.
For apps to be able to autocomplete by known contacts we need some way to query these values. This would be very useful for person-tag
This is supported by the Drupal IndieWeb module and Indigenous for Android.
Example response
q=contact
Note: the _internal_url can be used for updating the contacts via micropub
Implementations
Clients:
Servers: