Skip to content

Conversation

@dgw
Copy link
Member

@dgw dgw commented Nov 6, 2022

Description

Asked the creator of searchxkcd.com on Twitter about an API. Was told there is no true public API (yet), but I could pull the backend URL out of network tools. So have I done.

Makes the most sense to keep the original web_search() method around as a backup option. For example, two days after the latest comic's release on Friday (today is Sunday), searching searchxkcd.com for its title returns no results. For this special case we have the 'latest' operator, but there are no guarantees for how frequently searchxkcd's index is updated with fresh comics.

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make quality and make test)
  • I have tested the functionality of the things this change touches

Notes

Complements #2376, but shouldn't replace it. The two patches work together to fix and improve search results in xkcd.

Aside: Sure would be nice if xkcd itself provided a JSON file listing all of the comics' basic data in one place. The data already exists for each individual comic; that's how this plugin fetches comics by number.

@dgw dgw added the Feature label Nov 6, 2022
@dgw dgw added this to the 8.0.0 milestone Nov 6, 2022
@dgw dgw requested a review from a team November 6, 2022 22:35
Asked the creator of searchxkcd.com on Twitter about an API. Was told
there is no true public API (yet), but I could pull the backend URL out
of network tools. So have I done.

Makes the most sense to keep the original `web_search()` method around
as a backup option. For example, two days after the latest comic's
release on Friday (today is Sunday), searching searchxkcd.com for its
title returns no results. For this special case we have the 'latest'
operator, but there are no guarantees for how frequently searchxkcd's
index is updated with fresh comics.

Aside: Sure would be nice if xkcd itself provided a JSON file listing
all of the comics' basic data in one place. The data already exists for
each individual comic; that's how this plugin fetches comics by number.
@dgw dgw force-pushed the xkcd-search-provider branch from 9a43867 to 275a318 Compare November 6, 2022 22:37
Copy link
Contributor

@SnoopJ SnoopJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon further review, my remarks are nitpicks and insufficient reason not to make this PR green

@dgw dgw merged commit 4641949 into master Dec 29, 2022
@dgw dgw deleted the xkcd-search-provider branch December 29, 2022 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants