Git Product home page Git Product logo

opentdb-scraper's Introduction

opentdb-scraper

Scrapes OpenTDB's verified questions in a local JSON file titled "opentdb.json."

Usage

npm start -- <encodingFormat> [--beautify]

or

node src/index.js <encodingFormat> [--beautify]

Options:

EncodingFormat:

There's are four encoding options

  • urlLegacy Leagcy URL Encoding
  • url3986 URL Encoding (RFC 3986)
  • base64 Base64 Encoding

The last one, HTML Codes, will only be used if none of those options are specified

Examples from OpenTDB:

(Non-Encoded): Don't forget that π = 3.14 & doesn't equal 3.

HTML Code:

Don&‌#039;t forget that &‌pi; = 3.14 &‌amp; doesn&‌#039;t equal 3.

Legacy URL Encoding:

Don%27t+forget+that+%CF%80+%3D+3.14+%26+doesn%27t+equal+3.

URL Encoding (RFC 3986):

Don%27t%20forget%20that%20%CF%80%20%3D%203.14%20%26%20doesn%27t%20equal%203.

Base64 Encoding:

RG9uJ3QgZm9yZ2V0IHRoYXQgz4AgPSAzLjE0ICYgZG9lc24ndCBlcXVhbCAzLg==

--beautify

Beautifies the JSON with whitespace, if not specified the JSON will be compressed with no whitespace.

opentdb_questions.json

The opentdb_questions.json file contains all the verified questions scraped from this bot. The other json file, opentdb_questions_beautify.json, is the same except beautified. These are encoded with the default HTML Codes. It has been updated since 5/22/2023 (4,098 questions)

Examples

npm start -- urlLegacy --beautify (encoded with urlLegacy, beautified)

node src/index.js --beautify (encoded with HTML Codes, beautified)

npm start -- base64 (encoded with Base64, not beautified)

License

All data provided by openTDB is available under the Creative Commons Attribution-ShareAlike 4.0 International License. This code to scrape these question is however under the ISC license. Both licenses are available under the LICENSE file.

opentdb-scraper's People

Contributors

kickturn avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.