Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use resolve_object for better post matching #52

Open
micahmo opened this issue Oct 10, 2023 · 1 comment
Open

Use resolve_object for better post matching #52

micahmo opened this issue Oct 10, 2023 · 1 comment
Labels
enhancement New feature or request misc: good first issue Good for newcomers

Comments

@micahmo
Copy link

micahmo commented Oct 10, 2023

It looks like you are currently doing a search on title to find matching posts.

const response = await fetch(instance + '/api/v3/search?q=' + encodeURIComponent(postTitle) + '&type_=Posts', options);

You may find the resolve_object endpoint useful! You can pass a full URL to a post on another instance, and the instance which you are calling will try to resolve it.

For example, if I want to find https://ttrpg.network/post/1425970 on lemmy.ca, I call https://lemmy.ca/api/v3/resolve_object?q=https://ttrpg.network/post/1425970 and it returns (among other things) 6683650 which I can infer to https://lemmy.ca/post/6683650!

@cynber cynber added enhancement New feature or request misc: good first issue Good for newcomers labels Oct 10, 2023
@cynber
Copy link
Owner

cynber commented Oct 10, 2023

Thank you, that would be very helpful!

I'll change it in a future version unless someone else gets to it first :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request misc: good first issue Good for newcomers
Projects
Development

No branches or pull requests

2 participants