An open API service indexing awesome lists of open source software.

https://github.com/fed/lrn-logger


https://github.com/fed/lrn-logger

learnosity

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Logger

Simple logger API to keep track of random values generated dynamically by Items API and analyse their frequency.

## Running the API

```
npm start
```

## Logging values

```js
const itemsApp = LearnosityItems.init(window.activity, {
readyListener() {
const nodes = document.querySelectorAll('.lrn_stimulus_content > span > strong');
const values = Array.from(nodes).map(node => Number(node.textContent));

fetch(`http://localhost:6789/?values=${values}`).then(() => {
location.reload();
});
}
});
```

## Retrieving logged values

Just hit `http://localhost:6789/log`.