Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpbede/ratiocheck
Microservice to check image to content ratio of HTML pages
https://github.com/jpbede/ratiocheck
Last synced: 8 days 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 (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T10:58:51.000Z (6 months ago)
- Last Synced: 2024-05-22T11:57:18.330Z (6 months ago)
- Language: Go
- Homepage:
- Size: 152 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
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
### ShellYou 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
}
```