Skip to content

Commit

Permalink
add /api/frequency-list documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrey-wu committed Dec 25, 2023
1 parent fe61c76 commit 98729a3
Show file tree
Hide file tree
Showing 17 changed files with 251 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/api-docs/bonus-by-id.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down
3 changes: 3 additions & 0 deletions client/api-docs/check-answer.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down
191 changes: 191 additions & 0 deletions client/api-docs/frequency-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
<!doctype html>
<html lang="en">

<head>
<title>QB Reader</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="The API documentation for QB Reader.">

<link href="/images/apple-touch-icon.png" rel="apple-touch-icon">
<link href="/images/apple-touch-icon-precomposed.png" rel="apple-touch-icon-precomposed">
<link type="image/x-icon" href="/favicon.ico" rel="icon">

<link href="/bootstrap/light.css" rel="stylesheet">
<link href="/bootstrap/dark.css" rel="stylesheet" id="custom-css">
<script src="/apply-theme.js"></script>
</head>

<body>
<nav class="navbar navbar-light navbar-expand-lg bg-custom" id="navbar" style="z-index: 10">
<div class="container-fluid">
<a class="navbar-brand ms-1 py-0" id="logo" href="/">
<span class="logo-prefix">QB</span><span class="logo-suffix">Reader</span>
</a>
<button class="navbar-toggler" data-bs-target="#navbarSupportedContent" data-bs-toggle="collapse" type="button"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="/singleplayer">Singleplayer</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/multiplayer">Multiplayer</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/db">Database</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/geoword">Geoword</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="/api-docs" aria-current="page">API</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/settings">Settings</a>
</li>
</ul>
<div class="d-flex">
<ul class="navbar-nav mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="/user/login" id="login-link">Log in</a>
</li>
</ul>
</div>
</div>
</div>
</nav>

<div class="container-xl mt-3 mb-4 row">
<div class="col-md-1"></div> <!-- empty column for some left margin -->
<!-- docs sidebar -->
<div class="d-none d-md-block col-2 h-100" id="docsSidebar">
<h4 class="offcanvas-title" id="docsSidebarLabel">API Reference</h4>
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a href="/api-docs"><code>Overview</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/schemas"><code>Object Schemas</code></a>
</li>
<h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/query"><code>query</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/random-bonus"><code>random-bonus</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/random-tossup"><code>random-tossup</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/packet"><code>packet</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/packet-tossups"><code>packet-tossups</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/packet-bonuses"><code>packet-bonuses</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/num-packets"><code>num-packets</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/set-list"><code>set-list</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/bonus-by-id"><code>bonus-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list" class="active fw-semibold" aria-current="page"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
</li>
<h5 class="mt-4 mb-2">Other</h5>
<li class="nav-item">
<a href="/api-docs/check-answer"><code>check-answer</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/report-question"><code>report-question</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/random-name"><code>random-name</code></a>
</li>
</ul>
</div>

<div class="col-12 col-md-9">
<h3 class="md-4">
<div><code>GET</code> <code>qbreader.org/api/frequency-list</code></div>
</h3>

<p>
Get the most frequent tossup and bonus answers for the given subcategory.
</p>

<a href="#parameters" class="text-body">
<h4 class="mt-4 md-2" id="parameters">Parameters</h4>
</a>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div>
<code>subcategory</code><code class="text-muted">: string</code>
<code class="text-muted float-end fw-semibold text-decoration-underline">required</code>
</div>
<div>
The subcategory to get the list for.
</div>
</li>
<li class="list-group-item">
<div>
<code>limit</code><code class="text-muted">: number</code>
<code class="text-muted float-end fw-semibold text-decoration-underline">default: 100</code>
</div>
<div>
The maximum number of answers to return.
</div>
</li>
</ul>

<a href="#returns" class="text-body">
<h4 class="mt-4 md-2" id="returns">Returns</h4>
</a>
<div>
A JSON <code>object</code> with the following properties:
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div>
<code>frequencyList</code><code class="text-muted">: object[]</code>
</div>
<div>
An <code>array</code> of <code>objects</code> with the following properties, sorted by decreasing frequency:
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<code>answer</code><code class="text-muted">: string</code>
</li>
<li class="list-group-item">
<code>frequency</code><code class="text-muted">: number</code>
</li>
</ul>
</li>
</ul>
</div>
</div>

<script src="/bootstrap/bootstrap.bundle.min.js"></script>
<script src="/script.js"></script>
</body>

</html>
15 changes: 15 additions & 0 deletions client/api-docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down Expand Up @@ -197,12 +200,24 @@ <h5 class="mt-4 md-2">Database</h5>
</a>
<div>Get a list of all sets in the database.</div>
</li>
<li class="list-group-item">
<a href="/api-docs/bonus-by-id">
<div><code>GET</code> <code>/bonus-by-id</code></div>
</a>
<div>Get a single bonus by its ID.</div>
</li>
<li class="list-group-item">
<a href="/api-docs/tossup-by-id">
<div><code>GET</code> <code>/tossup-by-id</code></div>
</a>
<div>Get a single tossup by its ID.</div>
</li>
<li class="list-group-item">
<a href="/api-docs/frequency-list">
<div><code>GET</code> <code>/frequency-list</code></div>
</a>
<div>Get the most frequent tossup and bonus answers for the given subcategory.</div>
</li>
</ul>

<h5 class="mt-4 md-2">Multiplayer</h5>
Expand Down
3 changes: 3 additions & 0 deletions client/api-docs/multiplayer/room-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list" class="active fw-semibold" aria-current="page"><code>room-list</code></a>
Expand Down
3 changes: 3 additions & 0 deletions client/api-docs/num-packets.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down
3 changes: 3 additions & 0 deletions client/api-docs/packet-bonuses.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down
3 changes: 3 additions & 0 deletions client/api-docs/packet-tossups.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down
3 changes: 3 additions & 0 deletions client/api-docs/packet.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down
3 changes: 3 additions & 0 deletions client/api-docs/query.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down
3 changes: 3 additions & 0 deletions client/api-docs/random-bonus.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down
3 changes: 3 additions & 0 deletions client/api-docs/random-name.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down
3 changes: 3 additions & 0 deletions client/api-docs/random-tossup.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down
3 changes: 3 additions & 0 deletions client/api-docs/report-question.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down
3 changes: 3 additions & 0 deletions client/api-docs/schemas.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down
3 changes: 3 additions & 0 deletions client/api-docs/set-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down
3 changes: 3 additions & 0 deletions client/api-docs/tossup-by-id.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h5 class="mt-4 mb-2">Database</h5>
<li class="nav-item">
<a href="/api-docs/tossup-by-id" class="active fw-semibold" aria-current="page"><code>tossup-by-id</code></a>
</li>
<li class="nav-item">
<a href="/api-docs/frequency-list"><code>frequency-list</code></a>
</li>
<h5 class="mt-4 mb-2">Multiplayer</h5>
<li class="nav-item">
<a href="/api-docs/multiplayer/room-list"><code>room-list</code></a>
Expand Down

0 comments on commit 98729a3

Please sign in to comment.