<commit_before># chrome-print

A headless chrome process with an express-based API in front of it. Upload an
HTML file, specify width and height, get a png image back.

## Run

```bash
docker-compose up
```

## Usage

```bash
# get the port the server is listening on
port=`docker ps |grep chromeprint_print |sed 's/.*:\([0-9]*\)-.*/\1/'`

# send the request
curl \
  -F "htmlFile=@<EMAIL>" \
  -F "width=800" \
  -F "height=1200" \
  -X POST \
  -H "Content-Type: multipart/form-data" \
  -o test.png \
  http://localhost:$port/
```<commit_msg>added some attribution<commit_after># chrome-print

A headless chrome process with an express-based API in front of it. Upload an
HTML file, specify width and height, get a png image back.

## Run

```bash
docker-compose up
```

## Usage

```bash
# get the port the server is listening on
port=`docker ps |grep chromeprint_print |sed 's/.*:\([0-9]*\)-.*/\1/'`

# send the request
curl \
  -F "htmlFile=@<EMAIL>" \
  -F "width=800" \
  -F "height=1200" \
  -X POST \
  -H "Content-Type: multipart/form-data" \
  -o test.png \
  http://localhost:$port/
```

## Attribution

I basically copied and adapted code from [this
guy](https://medium.com/@dschnr/using-headless-chrome-as-an-automated-screenshot-tool-4b07dffba79a).
My whole solution is obviously cobbled together from various slapped together
sources, but it fits my needs.
{'fraction_non_alphanumeric': 0.15149308084486526, 'fraction_numerical': 0.01820830298616169, 'mean_word_length': 3.4038461538461537, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4751371', 'n_tokens_mistral': 532, 'n_tokens_neox': 481, 'n_words': 159}