<commit_before>{% extends "base.html" %}

{% block content %}

{% regroup pings by name as ping_names %}

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
  google.load("visualization", "1", {packages:["corechart"]});

  // Show hide code bubbles
  function toggle(id) {
    $('.code-example').not(id).hide();
    $(id).toggle();
  };

  // Submit form without redirect
  $(function () {
    $('#example-form').submit(function () {
        $.ajax({
            url: $(this).attr('action'),
            type: $(this).attr('method'),
            data: $(this).serialize(),
            success: location.reload()
          });
        return false;
    });
  });

</script>

<div class="container">
    <div class="row">
      <div class="col-md-8">

        <br><br>
        API Key: <b>{{user.public_key}}</b>
        <br><br>

        <button type="button" class="btn btn-primary" onclick="toggle('#html-example')">HTML Form Example</button>
        <button type="button" class="btn btn-primary" onclick="toggle('#php-example')">PHP Example</button>
        <button type="button" class="btn btn-primary" onclick="toggle('#python-example')">Python Example</button>
        <button type="button" class="btn btn-primary" onclick="toggle('#curl-example')">cURL Example</button>

        <div id="html-example" class="code-example unseen">
            <h4>HTML Form Example</h4>
            <hr>
            <br>
            <form id="example-form" action="/api" method="post">
                <input name="name" type="text" value="<NAME>" />
                <input name="value" type="numeric" value="10" />
                <input name="api_key" type="hidden" value="{{user.public_key}}" />
                <button type="submit" class="btn btn-primary">Submit</button>
            </form>
        </div>

        <div id="curl-example" class="code-example unseen">
            <h4>cURL Example (just copy-paste into your terminal window)</h4><commit_msg>Display Pings<commit_after>{% extends "base.html" %}

{% block content %}

{% regroup pings by name as ping_names %}

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
  google.load("visualization", "1", {packages:["corechart"]});

  // Show hide code bubbles
  function toggle(id) {
    $('.code-example').not(id).hide();
    $(id).toggle();
  };

  // Submit form without redirect
  $(function () {
    $('#example-form').submit(function () {
        $.ajax({
            url: $(this).attr('action'),
            type: $(this).attr('method'),
            data: $(this).serialize(),
            success: location.reload()
          });
        return false;
    });
  });

</script>

<div class="container">
    <div class="row">
      <div class="col-md-8">

        <br><br>
        API Key: <b>{{user.public_key}}</b>
        <br><br>

        <b>{{ pings }}</b>

        <button type="button" class="btn btn-primary" onclick="toggle('#html-example')">HTML Form Example</button>
        <button type="button" class="btn btn-primary" onclick="toggle('#php-example')">PHP Example</button>
        <button type="button" class="btn btn-primary" onclick="toggle('#python-example')">Python Example</button>
        <button type="button" class="btn btn-primary" onclick="toggle('#curl-example')">cURL Example</button>

        <div id="html-example" class="code-example unseen">
            <h4>HTML Form Example</h4>
            <hr>
            <br>
            <form id="example-form" action="/api" method="post">
                <input name="name" type="text" value="<NAME> Clowder" />
                <input name="value" type="numeric" value="10" />
                <input name="api_key" type="hidden" value="{{user.public_key}}" />
                <button type="submit" class="btn btn-primary">Submit</button>
            </form>
        </div>

        <div id="curl-example" class="code-example unseen">
            <h4>cURL Example (just copy-paste into your terminal window)</h4>
{'fraction_non_alphanumeric': 0.19274432379072062, 'fraction_numerical': 0.003948667324777887, 'mean_word_length': 2.6778584392014517, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 81, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '116819', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1176, 'n_words': 252}