Skip to content
Snippets Groups Projects
Commit 089b332d authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

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

Resolve "Use a proxy"

Closes #926

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