JSON of the pages#
Every public page has its information as JSON at the address of the page with
.json instead of the last /. The start page has /index.json.
Page |
JSON |
|---|---|
|
|
|
|
|
|
The JSON holds what a visitor who is not signed in sees, also when the request
carries the cookie of a session. Pages for signed-in people, such as
/account/, have no JSON. The site keeps no data of GitHub yet; the pages of
the numbers come with their JSON later.
Read it from other sites#
Every answer has the headers of CORS, Access-Control-Allow-Origin: *, so
JavaScript on any site can read it:
const site = "https://dashboard.pycal.org";
const start = await (await fetch(`${site}/index.json`)).json();
console.log(start.github_app ? "The GitHub App is registered" : "No GitHub App yet");
Or with curl:
curl https://dashboard.pycal.org/index.json
Failures#
A failure is JSON with error, status and detail:
NotFound(404)The page has no JSON, such as
/account.json, or does not exist.MethodNotAllowed(405)The JSON can only be read:
GET,HEADandOPTIONS.
An error of the site in a page is JSON with error, title, detail and
documentation, the link to its description in Errors.