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

Provide information on getting quotes from WikiQuotes or Goodreads #113

Open
toebes opened this issue Oct 15, 2018 · 2 comments
Open

Provide information on getting quotes from WikiQuotes or Goodreads #113

toebes opened this issue Oct 15, 2018 · 2 comments

Comments

@toebes
Copy link
Owner

toebes commented Oct 15, 2018

Provide an option to suggest random quotes from WikiQuotes/Goodreads with automatic scoring of the difficulty. Implement this by adding a button next to the cipher text labeled "Random Quote" that brings up a dialog that allows the user to choose the source (WikiQuotes/Goodreads) and whether to get the quote by topic/author/category. Once they select, present a second dialog with the list of topics/authors/categories available. When they select there, provide a RANDOMIZED list of quotes which are scored based on Chi-square and length. Allow them to click "get more" to augment the list.

@toebes
Copy link
Owner Author

toebes commented Oct 19, 2018

This is a one that someone who wrote for GoodReads which is probably a little overkill for what it needs to do and relies on several outside packages.
https://www.npmjs.com/package/goodreads-quote-scraper

However, this is a much more elegant one for WikiQuote
https://codepen.io/Eatcake/pen/ggxYeN?editors=1010
which uses the very elegant API that WikiQuote created
https://en.wikiquote.org/w/api.php
The magic for it is the start

function getRandomStart(callback) {
  $.ajax({
    url: api,
    data: {
      "action": "query",
      "format": "json",
      "titles": "List of people by name",
      "generator": "links",
      "gplnamespace": "0",
      "gpllimit": "20"
    },

The “titles”: “List of people by name” corresponds to the main page:
https://en.wikiquote.org/wiki/List_of_people_by_name
Likewise there is
https://en.wikiquote.org/wiki/List_of_television_shows
https://en.wikiquote.org/wiki/List_of_films
https://en.wikiquote.org/wiki/List_of_literary_works

@toebes toebes added this to the 2023-2024 Season milestone May 25, 2023
@toebes
Copy link
Owner Author

toebes commented Dec 10, 2023

This really shouldn't be integrated into the web page code, but a set of standalone scripts that people can use for their own scraping. We should put the information about running them on the how to page along with links to the scripts.

@RanTheLab RanTheLab changed the title Provide ability to get random quote from WikiQuotes or Goodreads Provide information on getting quotes from WikiQuotes or Goodreads Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants