/** * Download the HTML content * * @access public * @return HTML content */ public function download() { $client = Client::getInstance(); if ($this->config !== null) { $client->setTimeout($this->config->getGrabberTimeout())->setUserAgent($this->config->getGrabberUserAgent())->setMaxRedirections($this->config->getMaxRedirections())->setMaxBodySize($this->config->getMaxBodySize())->setProxyHostname($this->config->getProxyHostname())->setProxyPort($this->config->getProxyPort())->setProxyUsername($this->config->getProxyUsername())->setProxyPassword($this->config->getProxyPassword()); } $client->execute($this->url); $this->html = $client->getContent(); $this->encoding = $client->getEncoding(); return $this->html; }
/** * Set config object * * @access public * @param \PicoFeed\Config $config Config instance * @return \PicoFeed\Client */ public function setConfig($config) { $this->setTimeout($config->getGrabberTimeout()); $this->setUserAgent($config->getGrabberUserAgent()); $this->setMaxRedirections($config->getMaxRedirections()); $this->setMaxBodySize($config->getMaxBodySize()); $this->setProxyHostname($config->getProxyHostname()); $this->setProxyPort($config->getProxyPort()); $this->setProxyUsername($config->getProxyUsername()); $this->setProxyPassword($config->getProxyPassword()); return $this; }