Skip to content
This repository was archived by the owner on Aug 19, 2020. It is now read-only.
/ xkcd-cache Public archive

a caching server for XKCD comics to enable fast complete downloads for the XKCD application

License

Notifications You must be signed in to change notification settings

famoser/xkcd-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9e3b56f · Aug 20, 2019

History

47 Commits
Aug 19, 2019
Aug 19, 2019
Aug 19, 2019
Aug 19, 2019
Aug 20, 2019
Aug 19, 2019
Aug 19, 2019
Sep 4, 2017
Sep 4, 2017
Aug 19, 2019
Aug 19, 2019
Sep 4, 2017
Aug 19, 2019
Aug 19, 2019
Aug 19, 2019
Aug 19, 2019
Aug 19, 2019
Aug 19, 2019
Aug 19, 2019
Aug 19, 2019
Aug 19, 2019
Aug 19, 2019

Repository files navigation

XKCD.Cache

This is a cache of the comics at XKCD. It allows to download a zip with all published images in a single request.

MIT licensed CircleCI Scrutinizer Code Quality codecov

Endnodes

/

displays a html explanation page

/download/zip

downloads the zip with the image files contained in the cache

/download/json

downloads a json with all json data contained in the cache

/refresh

downloads all images & json missing from the cache. the response is of the following form:

{
    "successful": true,
    "error_message": null,
    "missing_images": [],
    "missing_json": [],
    "refresh_count": 0,
    "refresh_cap": 10,
    "refresh_pending": false
}

successful is a boolean indicating if the request was successful (true) or if an error occurred (false).
missing_images contains an array of all images it failed to download. This array might not be empty.
missing_json contains an array of all json it failed to download. This array should be empty.
error_message is a string and contains the error if successful is set to true.
refresh_count is an int indicating how many images were downloaded in the refresh step
refresh_cap is an int indicating how many images are max downloaded in each refresh step
refresh_pending is a bool which is true if further refresh calls are necessary to refresh cache

/status

checks if the cache is hot (all images all downloaded). the response is of the following form:

{
    "successful": true,
    "error_message": null,
    "hot": true,
    "latest_image_published": 400,
    "latest_image_cached": 400,
    "api_version": 1
}

successful is a boolean indicating if the request was successful (true) or if an error occurred (false). error_message is a string and contains the error if successful is set to true.
hot is a boolean. If set to true the cache is fresh (no files missing). If set to false, you may call /refresh to refresh the cache.
latest_image_published is an int which is the number of the last published image on XKCD. latest_image_cached is an int which is the number of the last cached image in the cache. this number is smaller / equal the number in latest_image_published and ideally the same. api_version is an int containing the version of the deployed API.

About

a caching server for XKCD comics to enable fast complete downloads for the XKCD application

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published