Get replies/reblogs/favourites count via uri
!Friendica Support
If I have the URI of a post (e.g. https://monrepos.casa/objects/0e03068e-3466-3cb4-8207-08c267219144
) and retrieve it via a JSON API call, I get the ActivityPub representation of that post. This does not include the replies/reblogs/favourites count.
If I retrieve the post through the Mastodon-compatible API, using its local id (e.g. https://monrepos.casa/api/v1/statuses/342306
) I will get the counts, as well as the URI.
But if I'm starting with the URI, how do I get the local id to then call that API?
Friendica Support reshared this.
Gordon Pedersen
in reply to Gordon Pedersen • •diaspora:guid
value into a local id compatible with the Mastodon API?Friendica Support reshared this.
Hypolite Petovan
in reply to Gordon Pedersen • • •@Gordon Pedersen The identifier you're looking for is called
uri-id
, it's a numerical representation of all the URIs that are recorded by a Friendica node. Every post has one, as well as all contacts, etc...The
item-uri
table actually makes the correlation between aguid
and auri-id
.Gordon Pedersen
in reply to Hypolite Petovan • •Is there any API I can use to access that correlation? Or is it only possible to figure out within Friendica itself?
Friendica Support reshared this.
Hypolite Petovan
in reply to Gordon Pedersen • • •/api/v2/search
) to return the post object including its identifier. Just use the remote post URL as search string. Here's the documentation for it: docs.joinmastodon.org/methods/…Gordon Pedersen
in reply to Hypolite Petovan • •That endpoint requires auth, right? Either way, I'll give it a go, thanks 👍
Friendica Support reshared this.
Hypolite Petovan
in reply to Gordon Pedersen • • •Gordon Pedersen likes this.
Hypolite Petovan
in reply to Gordon Pedersen • • •Gordon Pedersen
in reply to Hypolite Petovan • •I'm experimenting with showing the counts on my personal blog.
deathau.weblog.lol/
If you click the icon on the top right (or any "Interact on the Fediverse" link) then enter your handle, the page should refresh and show counts on posts.
Friendica Support reshared this.
Hypolite Petovan
in reply to Gordon Pedersen • • •@Gordon Pedersen Oh, I see, definitely an interesting feature, although as you've found out, there's no reference to the
uri-id
in the public ActivityPub representation of a post.@Michael Vogel What are the risks of including the
uri-id
of a post in the/objects/
output?Michael Vogel
in reply to Hypolite Petovan • • •Hypolite Petovan
in reply to Michael Vogel • • •@Michael Vogel @Gordon Pedersen We're already exposing the non-standard
diaspora:guid
field.The alternative seems to start accepting a URL as a parameter for the
/api/v1/statuses/
API endpoint, before it's converted touri-id
.Michael Vogel
in reply to Hypolite Petovan • • •Hypolite Petovan
in reply to Michael Vogel • • •