Здравствуйте с опциями вроде все понятно но вот есть загвоздка как передать апарсеру фильтр по регулярному выражению вот код:
возможно ли как то передать именно этот параметр? http://prntscr.com/cdxv0o
Код:
function aparser($s,$minblock){
$aparser = 'http://host:9091/API';
$request = json_encode(
array(
'action' => 'oneRequest',
'data' => array (
'options' => array (
0 => array (
'value' => $minblock,
'type' => 'override',
'id' => 'minblocklength',
),
1 => array (
'value' => '200 ok',
'type' => 'override',
'id' => 'goodstatus',
),
),
'parser' => 'HTML::TextExtractor',
'preset' => 'noproxy',
'threads' => 1,
'query' => $s
),
'password' => 'pass'
)
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $aparser);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Length: ' . strlen($request)));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/plain; charset=UTF-8'));
$response = curl_exec($ch);curl_close($ch);
$response = json_decode($response, true);
$text = $response['data']['resultString'];
return $text;
}