Skip to content

Instantly share code, notes, and snippets.

@j67678
Last active October 13, 2015 03:51
Show Gist options
  • Save j67678/35e285c1f2ccf3ff77a6 to your computer and use it in GitHub Desktop.
Save j67678/35e285c1f2ccf3ff77a6 to your computer and use it in GitHub Desktop.
<?php
$post = json_decode(file_get_contents("php://input"));
if (!$post) {
exit;
}
$max = 100;
$text = trim(substr($post->text, strlen($post->trigger_word)));
if ($text && is_numeric($text)) {
$max = $text;
}
echo json_encode([
'text' => "(0-$max) " . rand(0, $max)
], JSON_UNESCAPED_SLASHES);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment