Mercurial > hg > ywww
view examples/search/resultsSet.php @ 23:d606320ec331
post-5.7-upgrade efforts to reduce dropped connections, db insertion fails
| author | Charlie Root |
|---|---|
| date | Sun, 30 Dec 2018 07:00:09 -0500 |
| parents | 077b0a0a3e6d |
| children |
line wrap: on
line source
<?php class resultsSet { var $searchType; var $count; function __construct($type, $cnt) { include_once('constants.php'); $this->searchType = $type; $this->count = $cnt; } function getXMLResults($query){ $API = 'http://boss.yahooapis.com/ysearch/'.$this->searchType .'/v1/'; $request = $API . $query .'?format=xml&appid='. APP_ID . '&count=' . $this->count ; //echo $request; $ch = curl_init($request); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); $output = curl_exec($ch); curl_close($ch); //echo $output; $xml = simplexml_load_string ($output); return $xml; } }
