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

XKCD Parser - If a number is passed in, it should query that specific number #245

Closed
chelming opened this issue Oct 3, 2023 · 7 comments · Fixed by #262
Closed

XKCD Parser - If a number is passed in, it should query that specific number #245

chelming opened this issue Oct 3, 2023 · 7 comments · Fixed by #262
Assignees

Comments

@chelming
Copy link
Collaborator

chelming commented Oct 3, 2023

for whatever reason !xkcd 2834 returned https://xkcd.com/283/ as a result and left off the 4. The 4 was important!

@ajcooper72
Copy link
Contributor

I've got an update which I'll submit which follows these rules;

// if no parameters, display latest
// if number, display that number if valid otherwise random
// if -random then find a random
// anything else, do a search and display one of the results

@Lacah Lacah assigned Lacah and ajcooper72 and unassigned Lacah Oct 3, 2023
@Lacah
Copy link
Contributor

Lacah commented Oct 3, 2023

@ajcooper72 I've assigned it to you in attempt to avoid future conflicts. Let me know if you're not happy with it 😊

@earlduque
Copy link
Collaborator

works:

  • display latest
  • if number display that
  • if -random display random

doesn't work:

  • search seems super weak now. !xkcd exploits of a mom and !xkcd exploits fail completely and do not return anything

@ajcooper72
Copy link
Contributor

I'll have a look!

@ajcooper72
Copy link
Contributor

@earlduque there's an issue with the terms not been encoded in the URI which I can fix.

As for the quality of the search results, explainxkcd returns two sets of results, page title and page text. Page text, especially when you introduce words like 'of' become quite random. We could just take the page title results and randomise those?

@earlduque
Copy link
Collaborator

I'm down for whatever peeps think best lol ¯_(ツ)_/¯

@ajcooper72
Copy link
Contributor

The latest release 'fixes' the search results for random. Given a search term, it removes any insignificant words (if, on, an etc) and them performs the search. The results found in Page Title are prioritised over Page Text. This is not a perfect solution, but fixes the use cases put forward across the various issues raised.

As this issue was regarding pulling the comic number, I would consider this issue closed.

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 a pull request may close this issue.

4 participants