Ejemplo n.º 1
0
 /**
  * Retrieves $conf['range']kB of $url and returns headers and retrieved body.
  */
 function getPage($url)
 {
     $range = $this->getConf('range') * 1024;
     $http_client = new LinkbackHTTPClient();
     $http_client->headers['Range'] = 'bytes=0-' . $range;
     $http_client->max_bodysize = $range;
     $http_client->max_bodysize_limit = true;
     $retval = $http_client->get($url, true);
     return array('success' => $retval, 'headers' => $http_client->resp_headers, 'body' => $http_client->resp_body, 'error' => $http_client->error, 'status' => $http_client->status);
 }
Ejemplo n.º 2
0
 /**
  * Pings a given page with the given info.
  */
 function _ping_page($page, $linkback_info)
 {
     $range = $this->getConf('range') * 1024;
     $http_client = new LinkbackHTTPClient();
     $http_client->headers['Range'] = 'bytes=0-' . $range;
     $http_client->max_bodysize = $range;
     $http_client->max_bodysize_limit = true;
     $data = $http_client->get($page, true);
     if (!$data) {
         return false;
     }
     $order = explode(',', $this->getConf('order'));
     foreach ($order as $type) {
         if ($this->_ping_page_linkback(trim($type), $page, $http_client->resp_headers, $data, $linkback_info)) {
             return true;
         }
     }
     return false;
 }