One Line
Genius tracks metrics and user activity using the functions sendToLibrato and count, and users may need to go through a verification process before accessing the page.
Slides
Slide Presentation (9 slides)
Key Points
- The code includes a function called `sendToLibrato` that sends data to a server using either the `sendBeacon` method or the `fetch` method.
- The `sendToLibrato` function takes a parameter called `body`, which is an object containing the data to be sent.
- There is another function called `count` that takes two parameters: `name` and `source`. It also has an optional parameter called `extra`.
- The `count` function calls the `sendToLibrato` function, passing an object with the `counters` property, which contains an array of objects with `name`, `value`, and `source` properties.
- The `count` function also calls the `mixpanel.track` function, passing the `name` parameter and an object combining the `source` parameter and the `extra` parameter.
- The code includes error messages related to checking if the user is a human and verifying browser settings.
- The error messages mention JavaScript and cookies, indicating that these technologies are required for the page to load properly.
- The code snippet is incomplete and likely part of a larger codebase.
Summary
23 word summary
Genius uses the functions sendToLibrato and count to track metrics and user activity. Users may encounter a verification process before accessing the page.
Raw indexed text (715 chars / 89 words / 15 lines)
Genius
function sendToLibrato(body) \{ if (navigator.sendBeacon) \{
navigator.sendBeacon( METRICS\_URL, new Blob(\[JSON.stringify(body)\],
\{type: 'application/json'}) ); } else \{ fetch( METRICS\_URL, \{
method: 'POST', body: JSON.stringify(body), headers: \{'Content-Type':
'application/json'}, } ); } }
function count(name, \{source}, extra = \{}) \{
sendToLibrato(\{counters: \[\{name, value: 1, source}\]});
mixpanel.track(name, Object.assign(\{source}, extra)); }
Scrrrr!!
Sorry, we have to make sure you're a human before we can show you this page.
Please stand by, while we are checking your browser...
Redirecting...
Please turn JavaScript on and reload the page.
Please enable Cookies and reload the page.