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

A way to find all the endpoints of the API #18

Open
zebracanevra opened this issue May 3, 2014 · 1 comment
Open

A way to find all the endpoints of the API #18

zebracanevra opened this issue May 3, 2014 · 1 comment

Comments

@zebracanevra
Copy link

This is somewhat a duplicate of one of the points in #17.

Currently, there is no way for a program to deal with a change in endpoints, for example when the image URL changed from http(s)://i.4cdn.org/'board'/src/'tim'.'ext' to http(s)://i.4cdn.org/'board'/'tim'.'ext'. Active developers could change these URLs, but programs that weren't updated were left in the dust.

I propose a new file called options.json (or similar), sitting at the root of http(s)://a.4cdn.org/.
This file would define all the routes to allow for programs to dynamically resolve any and all URLs needed for operation.

It's format could perhaps be like follows:

{
    "version": 1,
    "json": {
        "thread": "a.4cdn.org/`board`/thread/`no`.json",
        "page": "a.4cdn.org/`board`/`page`.json",
        "catalog": "a.4cdn.org/`board`/catalog.json",
        "threads": "a.4cdn.org/`board`/threads.json",
        "boards": "a.4cdn.org/boards.json"
    },
    "images": "i.4cdn.org/`board`/`tim`.`ext`",
    "thumbnails": "t.4cdn.org/`board`/`tim`s.jpg",
    "spoiler": "s.4cdn.org/image/spoiler.png",
    "custom-spoiler": "s.4cdn.org/image/spoiler-`board``custom_spoiler`.png"
    "icons": {
         ...list of all the other icon resources go here
         ...again using the backtick if there is to be replacing (only country for now)
    }
}

The version would be incremented for any change to the API, allowing programs to output a warning if the API is a newer version than what has been programmed.

@czaks
Copy link

czaks commented May 17, 2014

Good proposal. How about a custom config for some boards? Some of them may have custom icons, etc. I'd propose also doing board/options.json. Also, including there links to the HTML versions of the threads may also be helpful.

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