/opentdb-emacs

An emacs package for using the opentdb api

Primary LanguageEmacs LispGNU General Public License v3.0GPL-3.0

opentdb-emacs

An emacs package for creating a quiz using the opentdb api.

Running a quiz:

Running the following interactive command will open a new buffer with the quiz:

(opentdb-next-question)

server-states

You can also fetch questions yourself and use them how you wish:

;; This function takes a lot of optional params for fetching the right questions. See opentdb.el for more info.
(opentdb-fetch-questions)

Configuration:

The following custom fields can be changed:

opentdb-difficulty

example: (setq opentdb-difficulty "medium")

Options:

  • nil (for all)
  • "easy"
  • "medium"
  • "hard"

opentdb-type:

example: (setq opentdb-type "multiple")

Options

  • nil (for any type)
  • "boolean"
  • "multiple"

opentdb-category

example (setq opentdb-category "9")

Options (note that this might be outdated, check the api):

  • "9" - "General Knowledge"
  • "10" - "Entertainment: Books"
  • "11" - "Entertainment: Film"
  • "12" - "Entertainment: Music"
  • "13" - "Entertainment: Musicals & Theatres"
  • "14" - "Entertainment: Television"
  • "15" - "Entertainment: Video Games"
  • "16" - "Entertainment: Board Games"
  • "17" - "Science & Nature"
  • "18" - "Science: Computers"
  • "19" - "Science: Mathematics"
  • "20" - "Mythology"
  • "21" - "Sports"
  • "22" - "Geography"
  • "23" - "History"
  • "24" - "Politics"
  • "25" - "Art"
  • "26" - "Celebrities"
  • "27" - "Animals"
  • "28" - "Vehicles"
  • "29" - "Entertainment: Comics"
  • "30" - "Science: Gadgets"
  • "31" - "Entertainment: Japanese Anime & Manga"
  • "32" - "Entertainment: Cartoon & Animations"

TODO

  • Make the answers clickable, to reveal the correct answer
  • Add custom face (colors/font styling) to the correct answer when revealed, so it pops out more.
  • Fetch multiple questions and cache them, instead of fetching one question at a time.
  • Add a way to provide and store a session token to avoid the same questions.