Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = addslashes(trim($_POST['username']));
- $apiToken = addslashes(trim($_POST['apiToken']));
- $cmd = addslashes(trim($_POST['cmd']));
- $botid = addslashes(trim($_POST['botid']));
- $xatBotCommand = addslashes(trim($_REQUEST['xatBotCommand']));
- if($username != '') {
- if($cmd != '') {$append .= '&cmd='.$cmd;}
- if($botid != '') {$append .= '&botid='.$botid;}
- if($xatBotCommand != '') {$append .= '&xatBotCommand='.urlencode($xatBotCommand);}
- $res = file_get_contents('http://arcbots.com/api.html&user='.$username.'&apiToken='.$apiToken.$append); //Curl and post can both be used as alternatives
- $data = json_decode($res,true);
- #print_r($data);
- if($data['errorCode'] == 1 || $data['errorCode'] == 2) {$errorLogin = true;} else {$errorLogin = false;}
- }
- if($errorLogin == true || $username == '' && $apiToken == '') {
- echo '
- <table style="border-style:solid;border-width:2px;">
- <form method="post" action="">';
- if($data['errorMessage'] != '') {echo '<tr><td colspan="2"><font color="red">'.$data['errorMessage'].'</font><hr /></td></tr>';}
- echo '
- <tr><td>Username:</td><td><input type="text" name="username" /></td></tr>
- <tr><td>Api Token:</td><td><input type="text" name="apiToken" /></td></tr>
- <tr>
- <td colspan="2">
- <center>
- <input type="submit" value="Login" />
- </center>
- </td>
- </tr>
- </form>
- </table>
- ';
- }
- elseif($username != '' && $apiToken != '') {
- echo '
- <table style="border-style:solid;border-width:2px;">
- <form method="post" action="">
- <tr>
- <td colspan="2">';
- if($data['errorMessage'] != '') {echo '<font color="red">'.$data['errorMessage'].'</font><hr />';}
- elseif($data['message'] != '') {echo '<font color="green">'.$data['message'].'</font><hr />';}
- echo '
- </td>
- </tr>
- <tr>
- <td colspan="2">
- BotID:
- <select name="botid">
- ';
- foreach($data['botIDs'] as $botIDs) {
- echo '<option value="'.$botIDs.'"';
- if($data['favoriteBotID'] != '' && $botIDs == $data['favoriteBotID']) {echo ' selected="selected"';}
- echo '>'.$botIDs.'</option>';
- }
- echo '
- </select><br />
- </td>
- </tr>
- <tr><td>Restart:</td><td><input type="radio" name="cmd" value="restart" /></td></tr>
- <tr><td>Stop:</td><td><input type="radio" name="cmd" value="stop" /></td></tr>
- <tr><th colspan="2"><hr />OR:</th></tr>
- <tr><td>Send Command: <input type="radio" name="cmd" value="sendCmd" /></tr>
- <tr><td><input type="text" name="xatBotCommand" placeholder="!say test" size="25"></input></td></tr>
- <tr>
- <td colspan="2">
- <center>
- <input type="hidden" name="username" value="'.$username.'" />
- <input type="hidden" name="apiToken" value="'.$apiToken.'" />
- <input type="submit" value="Submit" />
- </center>
- </td>
- </tr>
- </form>
- </table>
- ';
- }
- echo '
- <br /><hr />
- <b><font color="green">The below examples will help you start off making a platform, in which you can code to use with our API system:</b></font><br /><br />
- Web Applications:<br />
- <a href="http://pastebin.com/XATJY45n" target="_blank" rel="nofollow">Download The Above Source Code</a><br />
- <a href="http://arcbots.com/mobile/mini/" target="_blank" rel="nofollow">ARCbot Mobile Website, using the api</a><br /><br />
- Desktop Web Applications:<br />
- <a href="http://www.mediafire.com/download.php?tb89h7b29da2cnw" target="_blank" rel="nofollow">Source Code of ARCbot Desktop Application V2 - Visual Basics</a><br />
- <a href="http://www.mediafire.com/download.php?edad07n1ggcr27j" target="_blank" rel="nofollow">ARCbots Desktop Application V2 - Pre-compiled exe file</a><br /><br />
- ';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement