當前位置: 首頁>>代碼示例>>PHP>>正文


PHP HttpRequest::sendRequest方法代碼示例

本文整理匯總了PHP中HttpRequest::sendRequest方法的典型用法代碼示例。如果您正苦於以下問題:PHP HttpRequest::sendRequest方法的具體用法?PHP HttpRequest::sendRequest怎麽用?PHP HttpRequest::sendRequest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在HttpRequest的用法示例。


在下文中一共展示了HttpRequest::sendRequest方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getVisibilityIndex

 /**
  * Returns the Sistrix visibility index
  *
  * @access        public
  * @param   url   string     The URL to check.
  * @return        integer    Returns the Sistrix visibility index.
  * @link    http://www.sistrix.com/blog/870-sistrix-visibilityindex.html
  */
 public function getVisibilityIndex($url = false)
 {
     $url = false != $url ? $url : self::getUrl();
     $domain = UrlHelper::getHost($url);
     $dataUrl = sprintf(services::SISTRIX_VI_URL, urlencode($domain));
     $html = HttpRequest::sendRequest($dataUrl);
     preg_match_all('#<h3>(.*?)<\\/h3>#si', $html, $matches);
     return isset($matches[1][0]) ? $matches[1][0] : intval('0');
 }
開發者ID:Nubtehy,項目名稱:openProjects,代碼行數:17,代碼來源:seostats.sistrix.php

示例2: getPageMetrics

 public function getPageMetrics($url = false)
 {
     $url = false != $url ? $url : self::getUrl();
     $dataUrl = sprintf(services::OPENSITEEXPLORER_URL, 'links', '1', $url);
     $html = HttpRequest::sendRequest($dataUrl);
     $doc = new DOMDocument();
     @$doc->loadHtml($html);
     $data = $doc->getElementsByTagName('td');
     return array('domainAuthority' => trim(strip_tags($data->item(0)->textContent)), 'pageAuthority' => trim(strip_tags($data->item(1)->textContent)), 'linkingRootDomains' => trim(strip_tags($data->item(2)->textContent)), 'totalInboundLinks' => trim(strip_tags($data->item(3)->textContent)));
 }
開發者ID:Nubtehy,項目名稱:openProjects,代碼行數:10,代碼來源:seostats.opensiteexplorer.php

示例3: httpSendWrapper

 private function httpSendWrapper($request)
 {
     $request .= !empty($this->cx) ? "&cx={$this->cx}&key={$this->key}" : '';
     return HttpRequest::sendRequest($request);
 }
開發者ID:Nubtehy,項目名稱:openProjects,代碼行數:5,代碼來源:seostats.google.php

示例4: _getAlexaPage

 private function _getAlexaPage($url)
 {
     $domain = UrlHelper::getHost($url);
     $dataUrl = sprintf(services::ALEXA_SITEINFO_URL, $domain);
     return HttpRequest::sendRequest($dataUrl);
 }
開發者ID:Nubtehy,項目名稱:openProjects,代碼行數:6,代碼來源:seostats.alexa.php

示例5: getVKontakteShares

 /**
  * Returns the total count of URL shares via VKontakte
  *
  * @access        public
  * @param   url   string     The URL to check.
  * @return        integer    Returns the total count of URL shares.
  */
 public function getVKontakteShares($url = false)
 {
     $url = false != $url ? $url : self::getUrl();
     $dataUrl = sprintf(services::VKONTAKTE_INFO_URL, urlencode($url));
     $htmlData = HttpRequest::sendRequest($dataUrl);
     preg_match_all('#^VK\\.Share\\.count\\(1, (\\d+)\\);$#si', $htmlData, $matches);
     return isset($matches[1][0]) ? intval($matches[1][0]) : intval('0');
 }
開發者ID:Nubtehy,項目名稱:openProjects,代碼行數:15,代碼來源:seostats.social.php

示例6: getApiData

 private function getApiData($url)
 {
     $jsonData = HttpRequest::sendRequest($url);
     return json_decode($jsonData, true);
 }
開發者ID:Nubtehy,項目名稱:openProjects,代碼行數:5,代碼來源:seostats.semrush.php


注:本文中的HttpRequest::sendRequest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。