Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Important data missing from the API #22

Closed
floens opened this issue Aug 8, 2014 · 4 comments
Closed

Important data missing from the API #22

floens opened this issue Aug 8, 2014 · 4 comments

Comments

@floens
Copy link

floens commented Aug 8, 2014

I think that some important data is missing from the api as it currently exists.
Now apps need to hardcode the configurations into their code, and need to update each time a new board is created, or when a board changes config.
The boards.json file already exists, and I think it would be a good idea to put these settings in there.

The following board configurations are missing from the api:

  • are image spoilers enabled (and how many spoiler images are there)
  • are text spoilers enabled
  • supported filetypes
  • max file size
  • max webm size
  • thread cooldown time
  • reply cooldown time
  • image cooldown time
  • comment character limit
  • is preupload_captcha supported
  • are ID's enabled

And optionally, knowing these would be nice (see also #17 and #18), but they are really specific:

  • Country flags enabled, and if they're /troll/ flags or not
  • [code] tag support
  • [math] tag support
  • The current announcement
  • min/max image dimensions

About the image spoiler thing, it currently exists on threads OPs, but there is no way to know if image spoilering is supported when posting.
I know that the api is read-only, but this would help me out a lot.

I suggest the following in the boards.json:

{
    "boards": [
        {
            "board": "hr",
            "title": "High Resolution",
            "ws_board": 0,
            "per_page": 15,
            "pages": 10,

            "cooldowns": {
                "thread": 600,
                "reply": 30,
                "image": 60,
            },

            "file_types": ["gif", "webm", "png", "jpg", "pdf", ...],
            "max_file_size": 8388608,
            "max_webm_size": 3145728,
            "max_comment_length": 2000,

            "preupload_captcha_enabled": 1,
            "uid_enabled": 0,
            "image_spoiler_enabled": 4,
            "text_spoiler_enabled": 0
        },
        ...
    ]
}

Optionally, I suggest encoding the file_types like this, if the max sizes differ per type. (It already differs for webms):

"files": {
    "pdf": {
        "max_size": 4194304
    },
    "webm": {
        "max_size": 3145728
    },
    "png": {
        "max_size": 3145728
    },
    ...
}
@desuwa
Copy link
Contributor

desuwa commented Aug 12, 2014

We added some more data to boards.json

@floens
Copy link
Author

floens commented Aug 12, 2014

Thank you, this makes me very happy!

One question for clarification: the spoiler tag is optional, but /r9k/ and /u/ have spoilers: 0. What does this mean?

@desuwa
Copy link
Contributor

desuwa commented Aug 12, 2014

but /r9k/ and /u/ have spoilers: 0

That would be a bug.

"spoilers": 1 = spoilers enabled (text and images)
"custom_spoilers": 5 = board has 5 custom spoiler images

@floens
Copy link
Author

floens commented Aug 12, 2014

Ok got it.
Closing the issue because everything's implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants