https://github.com/jpbede/ratiocheck
Microservice to check image to content ratio of HTML pages
https://github.com/jpbede/ratiocheck
Last synced: 5 months ago
JSON representation
Microservice to check image to content ratio of HTML pages
- Host: GitHub
- URL: https://github.com/jpbede/ratiocheck
- Owner: jpbede
- License: mit
- Created: 2022-07-28T07:24:15.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2026-02-05T12:31:34.000Z (6 months ago)
- Last Synced: 2026-02-05T23:54:56.284Z (6 months ago)
- Language: Go
- Homepage:
- Size: 185 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# ratiocheck
Microservice to check image to content ratio of HTML pages
## Requirements
When running outside the docker container a Chrome installation is required.
## Installing
### Binaries
You find pre-compiled binaries and packages for the most common OS under the [releases](https://github.com/jpbede/ratiocheck/releases).
### Docker
```shell
docker run -p 3000:3000 ghcr.io/jpbede/ratiocheck:latest
```
or via `docker-compose.yml`
```yaml
version: "3"
services:
ratiocheck:
image: ghcr.io/jpbede/ratiocheck:latest
ports:
- 3000:3000
```
### macOS
Simply use `homebrew` (https://brew.sh/)
To install `ratiocheck` use following command `brew install jpbede/tap/ratiocheck`
## Using it
### Shell
You can run a check by issuing following command:
```shell
ratiocheck check
```
### REST API
#### HTML
Do an HTTP POST call to `/html` endpoint with following JSON body:
```json
{
"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:
```json
{
"content_area": 1591200,
"image_area": 948332,
"ratio": 59.598541980894915
}
```
#### URL
Do an HTTP POST call to `/url` endpoint with following JSON body:
```json
{
"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:
```json
{
"content_area": 1591200,
"image_area": 948332,
"ratio": 59.598541980894915
}
```