I recall someone mentioning a way to do it through an ActivityPub “resolve object” endpoint (or something like that) but I couldn’t find anything on it again. #1101 will solve this, but how are you guys handling this in the meantime?

  • nmtake
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    5 months ago

    As you said, GET /resolove_object (https://join-lemmy.org/api/interfaces/ResolveObject.html) may work:

    $ post_id=9589178
    $ curl 'https://lemm.ee/api/v3/resolve_object?q=https%3A%2F%2Fprogramming.dev%2Fpost%2F${post_id}' | jq .post.post.id
    22873872
    $ curl 'https://lemm.ee/api/v3/post?id=22873872' | jq '.post_view.post | [.id, .name]'
    [
      22873872,
      "How do you get the url or id of the same post on a different instance?"
    ]
    
    • silas@programming.devOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 months ago

      Thanks! Exactly what I was looking for, I didn’t look at the docs thoroughly enough it seems

      • nmtake
        link
        fedilink
        arrow-up
        2
        ·
        5 months ago

        Glad it worked. I didn’t know the endpoint before reading your post.