예제 #1
0
파일: api.php 프로젝트: JaimeA/SkunkWrx
 $action = strtolower($_REQUEST["action"]);
 switch ($action) {
     case "create_db":
         $value = $api->create_db();
         break;
     case "oauth_call":
         if (isset($_REQUEST["method"]) && isset($_REQUEST["matchphrase"]) && in_array($_REQUEST["method"], $possible_method)) {
             $value = $api->oauth_call($_REQUEST["method"], $_REQUEST["matchphrase"], $_REQUEST["audience_phone"]);
         } else {
             $value = array("Response" => "Error");
         }
         exit(json_encode($value));
         break;
     case "send_answer":
         if (isset($_REQUEST["matchphrase"]) && isset($_REQUEST["character"]) && isset($_REQUEST["type"]) && isset($_REQUEST["index"])) {
             $value = $api->send_answer($_REQUEST["matchphrase"], $_REQUEST["character"], $_REQUEST["type"], $_REQUEST["index"]);
         } else {
             $value = array("Response" => "Error");
         }
         exit(json_encode($value));
         break;
     case "get_stats":
         $value = $api->get_stats();
         exit(json_encode($value));
         break;
     case "get_delay":
         $value = $api->get_delay();
         exit($value);
         break;
     case "set_delay":
         if (isset($_REQUEST["delay"]) && isset($_REQUEST["project_id"])) {