fork download
  1. $access_token = ".........";
  2. $verify_token = "huudepzai.vn";
  3. $hub_verify_token = null;
  4. if(isset($_REQUEST['hub_challenge'])) {
  5. $challenge = $_REQUEST['hub_challenge'];
  6. $hub_verify_token = $_REQUEST['hub_verify_token'];
  7. }
  8. if ($hub_verify_token === $verify_token){
  9. echo $challenge;
  10. }
  11. $input = json_decode(file_get_contents('php://input'), true);
  12. $sender = $input['entry'][0]['messaging'][0]['sender']['id'];
  13. $message = $input['entry'][0]['messaging'][0]['message']['text'];
  14. $message = strtolower($message);
  15. $message_to_reply = '';
  16. if ( $message == 'hi' || $message =='hello' || $message =='xin chào' || $message=='shop ơi' || $message =='alo' )
  17. {
  18. $result="Chào bạn! mình là bot trả lời tự động của fanpage để xem hướng dẫn sử dụng hãy gõ lệnh help.";
  19. $message_to_reply = $result;
  20. }
  21. else {
  22. $html='';
  23. if (strlen(strstr($message,'bot ngu')) > 0) {
  24. $html.='Bot thấy bạn còn ngu hơn bot ấy';
  25. }
  26. if (strlen(strstr($message,'bot ăn cứt')) > 0) {
  27. $html.='Bạn ăn trước đi rồi bot ăn';
  28. }
  29. if (strlen(strstr($message,'đẹp zai')) > 0) {
  30. $html.='Bot thấy anh hữu là đẹp zai nhất';
  31. }
  32. if (strlen(strstr($message,'khỏe')) > 0) {
  33. $html.='Bot khỏe như trâu luôn';
  34. }
  35. if (strlen(strstr($message,'ngủ')) > 0) {
  36. $html.='Bot chúc bạn ngủ ngon nhé!';
  37. }
  38. if (strlen(strstr($message,'yêu bot')) > 0) {
  39. $html.='Bot cũng yêu bạn';
  40. }
  41. if (strlen(strstr($message,'bot ơi')) > 0) {
  42. $html.='Dạ em đây ạ!';
  43. }
  44. if (strlen(strstr($message,'béo')) > 0) {
  45. $html.='Bot thấy chị Trang lonely là béo nhất luôn';
  46. }
  47. if (strlen(strstr($message,'xinh gái')) > 0) {
  48. $html.='Bot thấy chị Mai xinh gái nhất';
  49. }
  50. if (strlen(strstr($message,'thích ai')) > 0) {
  51. $html.='Bot thích chị Ngọc Trinh nhất nhưng chị ấy là của Hoàng Kiều mất rồi :(';
  52. }
  53. $message_to_reply = $html;
  54. }
  55. $url = 'https://g...content-available-to-author-only...k.com/v2.6/me/messages?access_token='.$access_token;
  56. $ch = curl_init($url);
  57. if($message_to_reply!='')
  58. $message_to_reply='[BOT] '.$message_to_reply;
  59. $jsonData = '{
  60. "recipient":{
  61. "id":"'.$sender.'"
  62. },
  63. "message":{
  64. "text":"'.$message_to_reply.'"
  65. }
  66. }';
  67. $jsonDataEncoded = $jsonData;
  68. curl_setopt($ch, CURLOPT_POST, 1);
  69. curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);
  70. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
  71. if(!empty($input['entry'][0]['messaging'][0]['message']) and $message_to_reply!=''){
  72. $result = curl_exec($ch);
  73. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
$access_token = ".........";
^
Main.java:2: error: class, interface, or enum expected
$verify_token = "huudepzai.vn";
^
Main.java:3: error: class, interface, or enum expected
$hub_verify_token = null;
^
Main.java:4: error: class, interface, or enum expected
if(isset($_REQUEST['hub_challenge'])) {
^
Main.java:4: error: unclosed character literal
if(isset($_REQUEST['hub_challenge'])) {
                   ^
Main.java:4: error: unclosed character literal
if(isset($_REQUEST['hub_challenge'])) {
                                 ^
Main.java:5: error: unclosed character literal
	$challenge = $_REQUEST['hub_challenge'];
	                       ^
Main.java:5: error: unclosed character literal
	$challenge = $_REQUEST['hub_challenge'];
	                                     ^
Main.java:6: error: class, interface, or enum expected
	$hub_verify_token = $_REQUEST['hub_verify_token'];
	^
Main.java:6: error: unclosed character literal
	$hub_verify_token = $_REQUEST['hub_verify_token'];
	                              ^
Main.java:6: error: unclosed character literal
	$hub_verify_token = $_REQUEST['hub_verify_token'];
	                                               ^
Main.java:7: error: class, interface, or enum expected
}
^
Main.java:10: error: class, interface, or enum expected
}
^
Main.java:11: error: unclosed character literal
$input = json_decode(file_get_contents('php://input'), true);
                                       ^
Main.java:12: error: unclosed character literal
$sender = $input['entry'][0]['messaging'][0]['sender']['id'];
                 ^
Main.java:12: error: unclosed character literal
$sender = $input['entry'][0]['messaging'][0]['sender']['id'];
                       ^
Main.java:12: error: unclosed character literal
$sender = $input['entry'][0]['messaging'][0]['sender']['id'];
                             ^
Main.java:12: error: unclosed character literal
$sender = $input['entry'][0]['messaging'][0]['sender']['id'];
                                       ^
Main.java:12: error: unclosed character literal
$sender = $input['entry'][0]['messaging'][0]['sender']['id'];
                                             ^
Main.java:12: error: unclosed character literal
$sender = $input['entry'][0]['messaging'][0]['sender']['id'];
                                                    ^
Main.java:12: error: unclosed character literal
$sender = $input['entry'][0]['messaging'][0]['sender']['id'];
                                                       ^
Main.java:12: error: unclosed character literal
$sender = $input['entry'][0]['messaging'][0]['sender']['id'];
                                                          ^
Main.java:13: error: class, interface, or enum expected
$message = $input['entry'][0]['messaging'][0]['message']['text'];
^
Main.java:13: error: unclosed character literal
$message = $input['entry'][0]['messaging'][0]['message']['text'];
                  ^
Main.java:13: error: unclosed character literal
$message = $input['entry'][0]['messaging'][0]['message']['text'];
                        ^
Main.java:13: error: unclosed character literal
$message = $input['entry'][0]['messaging'][0]['message']['text'];
                              ^
Main.java:13: error: unclosed character literal
$message = $input['entry'][0]['messaging'][0]['message']['text'];
                                        ^
Main.java:13: error: unclosed character literal
$message = $input['entry'][0]['messaging'][0]['message']['text'];
                                              ^
Main.java:13: error: unclosed character literal
$message = $input['entry'][0]['messaging'][0]['message']['text'];
                                                      ^
Main.java:13: error: unclosed character literal
$message = $input['entry'][0]['messaging'][0]['message']['text'];
                                                         ^
Main.java:13: error: unclosed character literal
$message = $input['entry'][0]['messaging'][0]['message']['text'];
                                                              ^
Main.java:14: error: class, interface, or enum expected
$message = strtolower($message);
^
Main.java:15: error: class, interface, or enum expected
$message_to_reply = '';
^
Main.java:15: error: empty character literal
$message_to_reply = '';
                    ^
Main.java:15: error: unclosed character literal
$message_to_reply = '';
                     ^
Main.java:16: error: unclosed character literal
if ( $message == 'hi' || $message =='hello' || $message =='xin ch?o' || $message=='shop ?i' || $message =='alo' )
                 ^
Main.java:16: error: unclosed character literal
if ( $message == 'hi' || $message =='hello' || $message =='xin ch?o' || $message=='shop ?i' || $message =='alo' )
                    ^
Main.java:16: error: unclosed character literal
if ( $message == 'hi' || $message =='hello' || $message =='xin ch?o' || $message=='shop ?i' || $message =='alo' )
                                    ^
Main.java:16: error: unclosed character literal
if ( $message == 'hi' || $message =='hello' || $message =='xin ch?o' || $message=='shop ?i' || $message =='alo' )
                                          ^
Main.java:16: error: unclosed character literal
if ( $message == 'hi' || $message =='hello' || $message =='xin ch?o' || $message=='shop ?i' || $message =='alo' )
                                                          ^
Main.java:16: error: unclosed character literal
if ( $message == 'hi' || $message =='hello' || $message =='xin ch?o' || $message=='shop ?i' || $message =='alo' )
                                                                   ^
Main.java:16: error: unclosed character literal
if ( $message == 'hi' || $message =='hello' || $message =='xin ch?o' || $message=='shop ?i' || $message =='alo' )
                                                                                  ^
Main.java:16: error: unclosed character literal
if ( $message == 'hi' || $message =='hello' || $message =='xin ch?o' || $message=='shop ?i' || $message =='alo' )
                                                                                          ^
Main.java:16: error: unclosed character literal
if ( $message == 'hi' || $message =='hello' || $message =='xin ch?o' || $message=='shop ?i' || $message =='alo' )
                                                                                                          ^
Main.java:16: error: unclosed character literal
if ( $message == 'hi' || $message =='hello' || $message =='xin ch?o' || $message=='shop ?i' || $message =='alo' )
                                                                                                              ^
Main.java:19: error: class, interface, or enum expected
	$message_to_reply = $result;
	^
Main.java:20: error: class, interface, or enum expected
}
^
Main.java:22: error: empty character literal
	$html='';
	      ^
Main.java:22: error: unclosed character literal
	$html='';
	       ^
Main.java:23: error: unclosed character literal
	if (strlen(strstr($message,'bot ngu')) > 0) {
	                           ^
Main.java:23: error: unclosed character literal
	if (strlen(strstr($message,'bot ngu')) > 0) {
	                                   ^
Main.java:24: error: unclosed character literal
		$html.='Bot th?y b?n c?n ngu h?n bot ?y';
		       ^
Main.java:24: error: unclosed character literal
		$html.='Bot th?y b?n c?n ngu h?n bot ?y';
		                                       ^
Main.java:26: error: unclosed character literal
	if (strlen(strstr($message,'bot ?n c?t')) > 0) {
	                           ^
Main.java:26: error: unclosed character literal
	if (strlen(strstr($message,'bot ?n c?t')) > 0) {
	                                      ^
Main.java:27: error: unclosed character literal
		$html.='B?n ?n tr??c ?i r?i bot ?n';
		       ^
Main.java:27: error: unclosed character literal
		$html.='B?n ?n tr??c ?i r?i bot ?n';
		                                  ^
Main.java:29: error: unclosed character literal
	if (strlen(strstr($message,'??p zai')) > 0) {
	                           ^
Main.java:29: error: unclosed character literal
	if (strlen(strstr($message,'??p zai')) > 0) {
	                                   ^
Main.java:30: error: unclosed character literal
		$html.='Bot th?y anh h?u l? ??p zai nh?t';
		       ^
Main.java:30: error: unclosed character literal
		$html.='Bot th?y anh h?u l? ??p zai nh?t';
		                                        ^
Main.java:32: error: unclosed character literal
	if (strlen(strstr($message,'kh?e')) > 0) {
	                           ^
Main.java:32: error: unclosed character literal
	if (strlen(strstr($message,'kh?e')) > 0) {
	                                ^
Main.java:33: error: unclosed character literal
		$html.='Bot kh?e nh? tr?u lu?n';
		       ^
Main.java:33: error: unclosed character literal
		$html.='Bot kh?e nh? tr?u lu?n';
		                              ^
Main.java:35: error: unclosed character literal
	if (strlen(strstr($message,'ng?')) > 0) {
	                           ^
Main.java:35: error: unclosed character literal
	if (strlen(strstr($message,'ng?')) > 0) {
	                               ^
Main.java:36: error: unclosed character literal
		$html.='Bot ch?c b?n ng? ngon nh?!';
		       ^
Main.java:36: error: unclosed character literal
		$html.='Bot ch?c b?n ng? ngon nh?!';
		                                  ^
Main.java:38: error: unclosed character literal
	if (strlen(strstr($message,'y?u bot')) > 0) {
	                           ^
Main.java:38: error: unclosed character literal
	if (strlen(strstr($message,'y?u bot')) > 0) {
	                                   ^
Main.java:39: error: unclosed character literal
		$html.='Bot c?ng y?u b?n';
		       ^
Main.java:39: error: unclosed character literal
		$html.='Bot c?ng y?u b?n';
		                        ^
Main.java:41: error: unclosed character literal
	if (strlen(strstr($message,'bot ?i')) > 0) {
	                           ^
Main.java:41: error: unclosed character literal
	if (strlen(strstr($message,'bot ?i')) > 0) {
	                                  ^
Main.java:42: error: unclosed character literal
		$html.='D? em ??y ?!';
		       ^
Main.java:42: error: unclosed character literal
		$html.='D? em ??y ?!';
		                    ^
Main.java:44: error: unclosed character literal
	if (strlen(strstr($message,'b?o')) > 0) {
	                           ^
Main.java:44: error: unclosed character literal
	if (strlen(strstr($message,'b?o')) > 0) {
	                               ^
Main.java:45: error: unclosed character literal
		$html.='Bot th?y ch? Trang lonely l? b?o nh?t lu?n';
		       ^
Main.java:45: error: unclosed character literal
		$html.='Bot th?y ch? Trang lonely l? b?o nh?t lu?n';
		                                                  ^
Main.java:47: error: unclosed character literal
	if (strlen(strstr($message,'xinh g?i')) > 0) {
	                           ^
Main.java:47: error: unclosed character literal
	if (strlen(strstr($message,'xinh g?i')) > 0) {
	                                    ^
Main.java:48: error: unclosed character literal
		$html.='Bot th?y ch? Mai xinh g?i nh?t';
		       ^
Main.java:48: error: unclosed character literal
		$html.='Bot th?y ch? Mai xinh g?i nh?t';
		                                      ^
Main.java:50: error: unclosed character literal
	if (strlen(strstr($message,'th?ch ai')) > 0) {
	                           ^
Main.java:50: error: unclosed character literal
	if (strlen(strstr($message,'th?ch ai')) > 0) {
	                                    ^
Main.java:51: error: unclosed character literal
		$html.='Bot th?ch ch? Ng?c Trinh nh?t nh?ng ch? ?y l? c?a Ho?ng Ki?u m?t r?i :(';
		       ^
Main.java:51: error: unclosed character literal
		$html.='Bot th?ch ch? Ng?c Trinh nh?t nh?ng ch? ?y l? c?a Ho?ng Ki?u m?t r?i :(';
		                                                                               ^
Main.java:54: error: class, interface, or enum expected
}
^
Main.java:55: error: unclosed character literal
$url = 'https://graph.facebook.com/v2.6/me/messages?access_token='.$access_token;
       ^
Main.java:57: error: class, interface, or enum expected
if($message_to_reply!='')
^
Main.java:57: error: empty character literal
if($message_to_reply!='')
                      ^
Main.java:57: error: unclosed character literal
if($message_to_reply!='')
                       ^
Main.java:58: error: unclosed character literal
	$message_to_reply='[BOT] '.$message_to_reply;
	                  ^
Main.java:58: error: unclosed character literal
	$message_to_reply='[BOT] '.$message_to_reply;
	                         ^
Main.java:59: error: class, interface, or enum expected
$jsonData = '{
^
Main.java:59: error: unclosed character literal
$jsonData = '{
            ^
Main.java:66: error: unclosed character literal
}';
 ^
Main.java:68: error: class, interface, or enum expected
curl_setopt($ch, CURLOPT_POST, 1);
^
100 errors
stdout
Standard output is empty