Commit 089b332d authored by Dominik Hebeler's avatar Dominik Hebeler

Merge branch '926-use-a-proxy' into 'development'

Resolve "Use a proxy"

Closes #926

See merge request !1496
parents fe83a72e 050a6582
......@@ -157,7 +157,7 @@ class RequestFetcher extends Command
curl_setopt($ch, CURLOPT_PROXY, $this->proxyhost);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->proxyuser . ":" . $this->proxypassword);
curl_setopt($ch, CURLOPT_PROXYPORT, $this->proxyport);
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
}
if (!empty($job["username"]) && !empty($job["password"])) {
......
......@@ -14,23 +14,29 @@ class Qualigo extends XmlSearchengine
protected function loadXmlResults($resultsXml)
{
$results = $resultsXml->xpath('//RL/RANK');
foreach ($results as $result) {
$title = $result->{"TITLE"}->__toString();
$link = $result->{"URL"}->__toString();
$anzeigeLink = $result->{"ORIGURL"}->__toString();
$descr = $result->{"ABSTRACT"}->__toString();
$this->counter++;
$this->ads[] = new \App\Models\Result(
$this->engine,
$title,
$link,
$anzeigeLink,
$descr,
$this->engine->{"display-name"},
$this->engine->homepage,
$this->counter
);
try {
$results = $resultsXml->xpath('//RL/RANK');
foreach ($results as $result) {
$title = $result->{"TITLE"}->__toString();
$link = $result->{"URL"}->__toString();
$anzeigeLink = $result->{"ORIGURL"}->__toString();
$descr = $result->{"ABSTRACT"}->__toString();
$this->counter++;
$this->ads[] = new \App\Models\Result(
$this->engine,
$title,
$link,
$anzeigeLink,
$descr,
$this->engine->{"display-name"},
$this->engine->homepage,
$this->counter
);
}
} catch (\Exception $e) {
Log::error("A problem occurred parsing results from $this->name:");
Log::error($e->getMessage());
return;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment