How to get URL of toot from toot ID?


#1

So, as you may have noticed, I am tinkling around with toot IDs. As you may have guessed it’s still for my add-on.

Now to illustrate what the add-on basically does:

  • “intercept” any remote interaction popup/request
  • for remote follows: get’s account to follow from URL (that’s fortunately easy)
  • for toot interactions: currently has to grab toot URL this interaction is about from the HTML page
  • then redirect to the “remote_follow”/“remote_interaction” endpoint of your own Mastodon instance directly, thus skipping entering the Mastodon handle in that “foreign” page

The way toot interactions are handled, is of course, not optimal for various reasons.
However, I found no easier way to get the URL the user is about to interact with from somewhere else.

What I am looking for is:

  • Is there any way to query a server with <localTootId> and get the full URL if the remote toot? Then I could do this and hopefully this would be faster than grabbing the HTML page.
  • Or just adjust the URL of the /interact/ page to mention the whole URI one is sharing, not only the local toot ID. Then I could grab it from there without waiting for the page load to finish.

#2

Yes, GET /api/v1/statuses/:id will contain url in the response


#3

Thanks, BTW, this has been implemented in v0.8 of my add-on.