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 site: search token for Reddit. #1003

Merged
merged 1 commit into from
Jan 11, 2021
Merged

Conversation

kevincox
Copy link
Contributor

@kevincox kevincox commented Jan 8, 2021

The previous search would not find results submitted to the site if the post title or text didn't contain the domain. This updates the search to include the submitted URL in the search. It also excludes the title from the search as that can't be a real link and IIUC will not actually be actioned upon by brid.ly anyways. Note that there is no guarantee that a selftext: match actually contains a link however the false-positives will be filtered out when searching for links to send the webmention.

Examples:

@snarfed
Copy link
Owner

snarfed commented Jan 9, 2021

Thank you for the contribution, this is great!

The CI failure is unrelated, and should be fixed now, feel free to rebase and re-push. Also sadly we don't have unit test coverage for this specific code path, but we should, I'll plan to add that soon.

Mind adding a link to the reddit API or search docs that describe these operators? Either to the search_for_links docstring, or directly above the usage? With that I'll gladly merge. Thanks again!

The previous search would not find results submitted to the site if the post title or text didn't contain the domain. This updates the search to include the submitted URL in the search. It also excludes the title from the search as that can't be a real link and IIUC will not actually be actioned upon by brid.ly anyways. Note that there is no guarantee that a `selftext:` match actually contains a link however the false-positives will be filtered out when searching for links to send the webmention.

Examples:

- https://www.reddit.com/search?q=%22kevincox.ca%22&t=all
- https://www.reddit.com/search?q=site%3A%22kevincox.ca%22&t=all
- https://www.reddit.com/search?q=selftext%3A%22kevincox.ca%22&t=all
- https://www.reddit.com/search?q=site%3A%22kevincox.ca%22+OR+selftext%3Akevincox.ca&t=all
@kevincox
Copy link
Contributor Author

Updated, should be good now.

@snarfed
Copy link
Owner

snarfed commented Jan 11, 2021

Looks great, thank you!

@snarfed snarfed merged commit bab8b38 into snarfed:master Jan 11, 2021
@snarfed
Copy link
Owner

snarfed commented Jan 11, 2021

This is deployed to production now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants