<commit_before># Substitutions

This repository provides a nodejs server downloading substitutions from *.edupage.org sites and presenting them on mobile-friendly website and sending them on Messenger.

## Configuring

How to configure your server.

### Setting up HTTPS

Your certificates and key should be placed in `./certs/` and named `wsskey.pem` (key), `wsscert.pem` (certificate) and `cacert.pem` (CA certificate).

If you don't have SSL certificates you can generate them for free using [Let's encrypt](https://letsencrypt.org/)

### Config file

You have to add a `config` file to `myModules/`. It contains data necessary to interact with Facebook.

It should look like this:

```javascript
var config = {};
config.clientId = '1xxxxxxxxxxxxxx2'; //App id - displayed in app dashboard on developers.facebook.com
config.url='https://your.url'; //website url
config.appSecret='<KEY>'; //App secret displayed in app dashboard
config.appToken='<KEY>'; //App token - see below
config.webhookToken='<PASSWORD>Token'; //used to verify url of your webhook - more below
config.pageToken='<KEY>'; //Page access token - see below
config.adm1='1xxxxxxxxxxxxxx1'; //1st adminitrator messenger id (new message and new user notifications)
config.adm2='1xxxxxxxxxxxxxx8'; //2nd adminitrator messenger id (new message notifications)
module.exports = config; //allow other modules to access your config
```

Read how to [generate app token](https://developers.facebook.com/docs/facebook-login/access-tokens#apptokens).

Read how to [setup a webhook](https://developers.facebook.com/docs/messenger-platform/guides/setup#webhook_setup) and [get a page access token](https://developers.facebook.com/docs/messenger-platform/guides/setup#page_access_token).

### Dependencies

Run `npm install` to install all required modules.

## Sterting

To start a server (listening on port 8080) run `node index.js` or `npm start`.

## License

See the [LICENSE](LICENSE.md) (MIT).<commit_msg>Shorten pageToken in README<commit_after># Substitutions

This repository provides a nodejs server downloading substitutions from *.edupage.org sites and presenting them on mobile-friendly website and sending them on Messenger.

## Configuring

How to configure your server.

### Setting up HTTPS

Your certificates and key should be placed in `./certs/` and named `wsskey.pem` (key), `wsscert.pem` (certificate) and `cacert.pem` (CA certificate).

If you don't have SSL certificates you can generate them for free using [Let's encrypt](https://letsencrypt.org/)

### Config file

You have to add a `config` file to `myModules/`. It contains data necessary to interact with Facebook.

It should look like this:

```javascript
var config = {};
config.clientId = '1xxxxxxxxxxxxxx2'; //App id - displayed in app dashboard on developers.facebook.com
config.url='https://your.url'; //website url
config.appSecret='<KEY>'; //App secret displayed in app dashboard
config.appToken='<KEY>'; //App token - see below
config.webhookToken='WebhookVerificationToken'; //used to verify url of your webhook - more below
config.pageToken='<PASSWORD>'; //Page access token - see below
config.adm1='1xxxxxxxxxxxxxx1'; //1st adminitrator messenger id (new message and new user notifications)
config.adm2='1xxxxxxxxxxxxxx8'; //2nd adminitrator messenger id (new message notifications)
module.exports = config; //allow other modules to access your config
```

Read how to [generate app token](https://developers.facebook.com/docs/facebook-login/access-tokens#apptokens).

Read how to [setup a webhook](https://developers.facebook.com/docs/messenger-platform/guides/setup#webhook_setup) and [get a page access token](https://developers.facebook.com/docs/messenger-platform/guides/setup#page_access_token).

### Dependencies

Run `npm install` to install all required modules.

## Sterting

To start a server (listening on port 8080) run `node index.js` or `npm start`.

## License

See the [LICENSE](LICENSE.md) (MIT).

{'fraction_non_alphanumeric': 0.11304567247035074, 'fraction_numerical': 0.0070653545293969215, 'mean_word_length': 4.943028485757122, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7599776', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1110, 'n_words': 422}