17 lines
596 B
PHP
17 lines
596 B
PHP
<?php
|
|
$uid = mt_rand(100,400000);
|
|
$ch = curl_init('http://push:8080/pub/'. $uid .'_channel');
|
|
# Setup request to send json via POST.
|
|
$payload = json_encode( array( "customer"=> $argv[1]) );
|
|
curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload );
|
|
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
|
|
# Return response instead of printing.
|
|
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
|
|
# Send request.
|
|
$result = curl_exec($ch);
|
|
var_export($result);
|
|
curl_close($ch);
|
|
# Print response.
|
|
//echo "<pre>$result</pre>";
|
|
//8839716547:AAHNDG5ezuBxKHVaFCIivq2hWrNjFxDMHMs
|
|
// 234706670
|