Advertisement
grinyam

Untitled

Aug 26th, 2016
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <?php
  2. $trailers = array('message' => array('message_id' => '0',
  3.                                 'chat' => array('id' => 'agaponiz'),
  4.                                 'text' => '/trailers',
  5.                                 'link' => 'www.kinopoisk.ru')
  6. );
  7.  
  8. /*
  9. print_r($trailers);
  10. $jsonTrailers = json_encode($trailers);
  11. print_r($jsonTrailers);
  12. */
  13.  
  14. $url = 'https://goslingbot.herokuapp.com/robot.php';
  15. $handle = curl_init($url);
  16. curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
  17. curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 5);
  18. curl_setopt($handle, CURLOPT_TIMEOUT, 60);
  19. curl_setopt($handle, CURLOPT_POSTFIELDS, json_encode($trailers));
  20. curl_setopt($handle, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
  21. curl_exec($handle);
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement