15
submitted 3 months ago by jmbreuer@lemmy.ml to c/lemmy_support@lemmy.ml

I believe this used to work with e.g. something like https://lemmy.ml/post/2401677@feddit.org (assuming federation works and is current and all that).

This URL format no longer seems to work, is there a new/different endpoint to achieve the same?

I've found that I can use https://feddit.org/post/2401677 as a search term on https://lemmy.ml/search but putting together the appropriate URL (https://lemmy.ml/search?q=https%3A%2F%2Ffeddit.org%2Fpost%2F2401677&type=All&listingType=All&page=1&sort=TopAll) with a bookmarklet does not quite work - it comes up showing "no results", but I can click on "Search" again without changing anything and the same page / very same URL loads again with the post I'm looking for as the only search result. This link in this post also shows this exact behavior for me.

Is there any convenient way at all to achieve this - something I can click once, like a bookmarklet?

For reference, here's my half-working one:

javascript:(function() {const myInst="https://lemmy.ml/";let currUrl=window.location.toString();let newUrl=myInst+"search?q="+encodeURIComponent(currUrl)+"&type=All&listingType=All&page=1&sort=TopAll";window.location=newUrl;})()
top 5 comments
sorted by: hot top controversial new old
[-] nmtake@lemm.ee 5 points 3 months ago

I think GET /api/v3/resolve_object should work:

curl --url-query q=https://feddit.org/post/2401677 \
    https://lemmy.ml/api/v3/resolve_object \
    | jq .

(note that the value of q is url-encoded by --url-query)

[-] Blaze@feddit.org 4 points 3 months ago
[-] LarmyOfLone@lemm.ee 1 points 3 months ago

That script works very well with violentmonkey. But not with greasymonkey.

[-] Andromxda@lemmy.dbzer0.com 1 points 3 months ago

Violentmonkey is better anyway

[-] Die4Ever@programming.dev 2 points 3 months ago

you might need this feature before it can be done easily https://github.com/LemmyNet/lemmy/issues/2987

this post was submitted on 31 Aug 2024
15 points (100.0% liked)

Lemmy Support

4674 readers
3 users here now

Support / questions about Lemmy.

Matrix Space: #lemmy-space

founded 5 years ago
MODERATORS