Get started with antimoderate CDN

MIT licensed

Antimoderate: library for minimal rate limiting on user inputs.

Tags:
  • antimoderate
  • image
  • progressive
  • loading

Stable version

Copied!

How to start using antimoderate CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with antimoderate CDN - cdnhub.io</title>
  <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
  <script src="https://cdn.cdnhub.io/antimoderate/0.0.2/antimoderate.min.js"></script>
  <script>
    const apiKey = 'YOUR_API_KEY'; // Replace with your API key

    const textInput = document.getElementById('textInput');
    const resultDiv = document.getElementById('result');

    const antimoderate = new Antimoderate({
      apiKey,
      language: 'en',
      threshold: 0.5,
    });

    const checkButton = document.getElementById('checkButton');
    checkButton.addEventListener('click', () => {
      const text = textInput.value;
      antimoderate.checkText(text)
        .then((result) => {
          resultDiv.textContent = result.message;
        })
        .catch((error) => {
          resultDiv.textContent = error.message;
        });
    });
  </script>
  <style>
    #result {
      color: red;
    }
  </style>
</head>
<body>
  <input type="text" id="textInput" placeholder="Enter text here">
  <button id="checkButton">Check Text</button>
  <div id="result"></div>
</body>
</html>
Copied!
Copied!
Copied!

All versions