Microservice to check image to content ratio of HTML pages
When running outside the docker container a Chrome installation is required.
You find pre-compiled binaries and packages for the most common OS under the releases.
docker run -p 3000:3000 ghcr.io/jpbede/ratiocheck:latest
or via docker-compose.yml
version: "3"
services:
ratiocheck:
image: ghcr.io/jpbede/ratiocheck:latest
ports:
- 3000:3000
Simply use homebrew
(https://brew.sh/)
To install ratiocheck
use following command brew install jpbede/tap/ratiocheck
You can run a check by issuing following command:
ratiocheck check <url to check>
Do an HTTP POST call to /html
endpoint with following JSON body:
{
"html": "<your html>"
}
As a result you will get the ratio image area to content area, the size of the content area and the size of the image area:
{
"content_area": 1591200,
"image_area": 948332,
"ratio": 59.598541980894915
}
Do an HTTP POST call to /url
endpoint with following JSON body:
{
"url": "<your url>"
}
As a result you will get the ratio image area to content area, the size of the content area and the size of the image area:
{
"content_area": 1591200,
"image_area": 948332,
"ratio": 59.598541980894915
}