Skip to content
This repository was archived by the owner on Aug 6, 2022. It is now read-only.

III.1. Static data

Andrey Bogdanov edited this page Feb 25, 2016 · 14 revisions

Static data is retrieved using HTTP POST request. The methods does not make any changes of the data. They are also guaranteed to not change until the server is restarted, so they may be cached safely.

Table of contents

Get base site description

/misc/base.json

Returns site information: date format, supported captcha engines, etc.

Example:

{
    "server": {
        "uptime": 147696.377
    },
    "site": {
        "protocol": "http",
        "domain": "localhost:8080",
        "pathPrefix": "",
        "locale": "en",
        "dateFormat": "DD/MM/YYYY ddd HH:mm:ss",
        "timeOffset": 180,
        "vkontakte": {
            "integrationEnabled": true,
            "appId": "Your VK API app ID"
        },
        "twitter": {
            "integrationEnabled": true
        }
    },
    "user": {
        "ip": "Your IP (IPv6)",
        "hashpass": "Your hashpass",
        "levels": {
            "3dpd": "SUPERUSER",
            "a": "SUPERUSER",
            "b": "SUPERUSER",
            ...
        },
        "loggedIn": true,
        "vkAuth": true
    },
    "styles": [
        {
            "name": "burichan",
            "title": "Burichan"
        },
        {
            "name": "futaba",
            "title": "Futaba"
        },
        ...
    ],
    "codeStyles": [
        {
            "name": "agate",
            "title": "Agate"
        },
        {
            "name": "androidstudio",
            "title": "Android Studio"
        },
        ...
    ],
    "deviceType": "desktop",
    "availableCodeLangs": [
        {
            "id": "accesslog",
            "name": "access.log"
        },
        {
            "id": "actionscript",
            "name": "ActionScript"
        },
        ...
    ],
    "maxSearchQueryLength": 50,
    "markupModes": [
        {
            "name": "NONE",
            "title": "No markup"
        },
        {
            "name": "EXTENDED_WAKABA_MARK",
            "title": "Extender WakabaMark only"
        },
        {
            "name": "BB_CODE",
            "title": "bbCode only"
        },
        {
            "name": "EXTENDED_WAKABA_MARK,BB_CODE",
            "title": "Extended WakabaMark and bbCode"
        }
    ],
    "supportedCaptchaEngines": [
        {
            "id": "codecha",
            "title": "Codecha - programmers captcha",
            "publicKey": "Your Codecha public key",
            "scriptSource": "/js/codecha-script.js",
            "widgetTemplate": "codechaWidget"
        },
        {
            "id": "google-recaptcha",
            "title": "Google reCAPTCHA",
            "publicKey": "Your Google reCAPTCHA public key",
            "scriptSource": "https://www.google.com/recaptcha/api.js",
            "widgetTemplate": "googleRecaptchaWidget"
        },
        ...
    ]
}

Get specific board description

/misc/board/<board_name>.json

Returns the description of a specific board.

Example:

{
    "board": {
        "name": "b",
        "title": "/b/rotherhood",
        "defaultUserName": "Anonympus",
        "showWhois": false,
        "hidden": false,
        "postingEnabled": true,
        "captchaEnabled": true,
        "maxEmailLength": 150,
        "maxNameLength": 50,
        "maxSubjectLength": 150,
        "maxTextLength": 15000,
        "maxPasswordLength": 50,
        "maxFileCount": 1,
        "maxFileSize": 15728640,
        "maxLastPosts": 3,
        "markupElements": [
            "BOLD",
            "ITALICS",
            "STRIKED_OUT",
            "UNDERLINED",
            "SPOILER",
            "QUOTATION",
            "UNORDERED_LIST",
            "ORDERED_LIST",
            "LIST_ITEM",
            "SUBSCRIPT",
            "SUPERSCRIPT",
            "URL"
        ],
        "supportedFileTypes": [
            "application/ogg",
            "application/pdf",
            "audio/mpeg",
            "audio/ogg",
            "audio/wav",
            "image/gif",
            "image/jpeg",
            "image/png",
            "video/mp4",
            "video/ogg",
            "video/webm"
        ],
        "supportedCaptchaEngines": [
            {
                "id": "codecha",
                "title": "Codecha - programmers captcha",
                "publicKey": "Your Codecha public key",
                "scriptSource": "/js/codecha-script.js",
                "widgetTemplate": "codechaWidget"
            },
            {
                "id": "google-recaptcha",
                "title": "Google reCAPTCHA",
                "publicKey": "Your Google reCAPTCHA public key",
                "scriptSource": "https://www.google.com/recaptcha/api.js",
                "widgetTemplate": "googleRecaptchaWidget"
            },
            ...
        ],
        "bumpLimit": 500,
        "postLimit": 1000,
        "bannerFileNames": [
            "1.png",
            "2.gif"
        ],
        "launchDate": "2015-02-12T21:00:00.000Z"
    }
}

Get all boards description

/misc/boards.json

Returns an array of objects describing all available boards.

Example:

{
    "boards": [
        {board},
        ...
    ]
}

Note: See III.1. Static data for {board} object example.

Get UI translations

/misc/tr.json

Returns an object-map of UI translations.

Example:

{
    "tr": {
        "toMarkupPageText": "Markup",
        "toHomePageText": "Homepage",
        "framedVersionText": "Framed version",
        ...
    }
}

Get list of template partials

/misc/partisls.json

Returns an array of all available template partials.

Example:

[
    "chatContact",
    "createAction",
    "favoritesElement",
    "fileInputs",
    "innerNavbar",
    "my-avatarList",
    "post",
    "postFile",
    "postFileThumb",
    "postName",
    "postReference",
    "postReferringPosts",
    "postSubject",
    "setVotingOpenedForm"
]

Clone this wiki locally