SATS/lib/api/send

47 lines
809 B
PHP
Executable File

#!/usr/bin/php
<?php
require_once __DIR__.'/../include/const';
// will send the request using `auth` for cyclic hash
/* [1] Fetch useful data
=========================================================*/
/* (1) Fetch target url */
$url = @file_get_contents(URL_CONF);
if( $url === false )
die(1);
/* (2) Fetch cyclic hash */
$hash = syscall(SOURCE_DIR.'/lib/cyclic-hash/hash');
echo $hash;
die(0);
/* [1] Create httpRequest basis
=========================================================*/
/* (1) Set URL */
$curl = curl_init($url);
/* (2) Specify that we want to catch result instead of displaying it */
curl_setopt($curl, CURLOPT_RETURNTRANSFERER, true);
/* (3) Set HTTP method -> POST */
curl_setopt($curl, CURLOPT_POST, true);
/* (4) Section Title */
?>