<commit_before># web-hooky
Performs a GET against a source `queryUrl` and requries per `queryInterval`, then does a POST to `hookUrl`. You can specify Basic auth credentials and other options. This is a working prototype, but not a supported product. Use at your own disrection.

# Getting started

## Install and start

* Install Node.js if you don't already have it.
* Clone this repo, then from bash:

```bash
npm install
npm start
```
## Create a Webhook for a source and target

 Now you must POST the definition of a hook to the server at `/hook`. 
 
### Example:

Using cURL:

```bash
curl -i -X POST \
   -H "Content-Type:application/json" \
   -d \
'{
  	"queryCreds": "<PASSWORD>",
  	"queryUrl": "https://www14.v1host.com/v1sdktesting/api/ActivityStream/Story%3a1124",
  	"queryRequeryParamsTemplate": "activityId=:body.id&direction=forward",
  	"queryInterval": 5000,
  	"hookUrl": "http://requestb.in/ol98pmol"
 }' \
 'http://localhost:9090/hook'
```

# JSON payload parameters

## queryUrl

The source URL to query and requery at a specified interval

example: "https://www7.v1host.com/V1Production/api/ActivityStream/Scope%3a653184"

## hookUrl

The target URL to which the results of querying and requerying `queryUrl` will be POSTed

example: http://requestb.in/o0uouoo0

## queryInterval

Polling interval in milliseconds

example: 5000

## queryRequeryParamsTemplate

A template for additional query parameters to include on requery attempts

example: for VersionOne Activity Stream, it's "activityId=:body.id&direction=forward"

## More  

There are other defaults inside the code that currently apply to VersionOne ActivityStream.<commit_msg>testing<commit_after># web-hooky
Performs a GET against a source `queryUrl` and requries per `queryInterval`, then does a POST to `hookUrl`. You can specify Basic auth credentials and other options. This is a working prototype, but not a supported product. Use at your own disrection.

# Getting started

## Install and start

* Install Node.js if you don't already have it.
* Clone this repo, then from bash:

```bash
npm install
npm start
```
## Create a Webhook for a source and target

 Now you must POST the definition of a hook to the server at `/hook`. 
 
### Example:

Using cURL:

```bash
curl -i -X POST \
   -H "Content-Type:application/json" \
   -d \
'{
  	"queryCreds": "<PASSWORD>",
  	"queryUrl": "https://www14.v1host.com/v1sdktesting/api/ActivityStream/Story%3a1124",
  	"queryRequeryParamsTemplate": "activityId=:body.id&direction=forward",
  	"queryInterval": 5000,
  	"hookUrl": "http://requestb.in/ol98pmol"
 }' \
 'http://localhost:9090/hook'
```

# JSON payload parameters

## queryUrl

The source URL to query and requery at a specified interval

example: "https://www7.v1host.com/V1Production/api/ActivityStream/Scope%3a653184"

## hookUrl

The target URL to which the results of querying and requerying `queryUrl` will be POSTed

example: http://requestb.in/o0uouoo0

## queryInterval

Polling interval in milliseconds

example: 5000

## queryRequeryParamsTemplate

A template for additional query parameters to include on requery attempts

example: for VersionOne Activity Stream, it's "activityId=:body.id&direction=forward"

## More  

There are other defaults inside the code that currently apply to VersionOne ActivityStream.

Testing
{'fraction_non_alphanumeric': 0.10033042955842596, 'fraction_numerical': 0.021027335536197057, 'mean_word_length': 4.432300163132137, 'pattern_counts': {'":': 10, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '432780', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1004, 'n_words': 372}