<commit_before>hospitality - welcome your guests
=========

Every visitor to your website is unique. You should treat them that way! Hospitality gives you the tools to modify page behavior and copy based on what type of visitor is currently viewing the page. There is default handling for:

- new visits
- return visits

It is trivial to implement your own types like `free user` or `paid user`.

## Implementation

Put this at the bottom of your page:

```html
<script src="/src/hospitality.js"></script>
<script>
  hospitality.init({
    visit: {
      new: function() { alert('new-user'); },
      return: function() { alert('return-user'); }
    }
  });
</script>
```

### Config

A new vs. return visit is more than just refreshing the page. To differentiate a return visit, this waits an hour after the first visit to treat the visitor as a return visitor. You can modify the wait via.

```javascript
hospitality.init({
  wait: 1000 * 60 // wait in ms.
});
```

By default, users are tracked on a per-domain basis. If you'd like to change that behavior, you can via:

```javascript
hospitality.init({
    domain: '.mydomain.com'
});
```

## Testing

1. Startup a web server from the root directory:

```bash
python -m SimpleHTTPServer
```

2. Go to the [test page](http://lvh.me:8080/test).
<commit_msg>formatting again<commit_after>hospitality - welcome your guests
=========

Every visitor to your website is unique. You should treat them that way! Hospitality gives you the tools to modify page behavior and copy based on what type of visitor is currently viewing the page. There is default handling for:

- new visits
- return visits

It is trivial to implement your own types like `free user` or `paid user`.

## Implementation

Put this at the bottom of your page:

```html
<script src="/src/hospitality.js"></script>
<script>
  hospitality.init({
    visit: {
      new: function() { alert('new-user'); },
      return: function() { alert('return-user'); }
    }
  });
</script>
```

### Config

A new vs. return visit is more than just refreshing the page. To differentiate a return visit, this waits an hour after the first visit to treat the visitor as a return visitor. You can modify the wait via.

```javascript
hospitality.init({
  wait: 1000 * 60 // wait in ms.
});
```

By default, users are tracked on a per-domain basis. If you'd like to change that behavior, you can via:

```javascript
hospitality.init({
    domain: '.mydomain.com'
});
```

## Testing

1. Startup a web server from the root directory:

    ```bash
    python -m SimpleHTTPServer
    ```

2. Go to the [test page](http://lvh.me:8080/test).

{'fraction_non_alphanumeric': 0.11545765286745158, 'fraction_numerical': 0.009115077857956703, 'mean_word_length': 3.637323943661972, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, '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': '3882981', 'n_tokens_mistral': 790, 'n_tokens_neox': 742, 'n_words': 351}