| @@ 43-53 (lines=11) @@ | ||
| 40 | * @return integer Returns the Sistrix visibility index. |
|
| 41 | * @link http://www.sistrix.com/blog/870-sistrix-visibilityindex.html |
|
| 42 | */ |
|
| 43 | public static function getVisibilityIndex($url = false) |
|
| 44 | { |
|
| 45 | $url = parent::getUrl($url); |
|
| 46 | $domain = Helper\Url::parseHost($url); |
|
| 47 | $dataUrl = sprintf(Config\Services::SISTRIX_VI_URL, urlencode($domain)); |
|
| 48 | ||
| 49 | $html = static::_getPage($dataUrl); |
|
| 50 | @preg_match_all('#<h3>(.*?)<\/h3>#si', $html, $matches); |
|
| 51 | ||
| 52 | return isset($matches[1][0]) ? $matches[1][0] : parent::noDataDefaultValue(); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Returns the Sistrix visibility index by using the SISTRIX API |
|
| @@ 91-100 (lines=10) @@ | ||
| 88 | * @param url string The URL to check. |
|
| 89 | * @return integer Returns the total count of URL shares. |
|
| 90 | */ |
|
| 91 | public static function getDeliciousShares($url = false) |
|
| 92 | { |
|
| 93 | $url = parent::getUrl($url); |
|
| 94 | $dataUrl = sprintf(Config\Services::DELICIOUS_INFO_URL, urlencode($url)); |
|
| 95 | ||
| 96 | $jsonData = parent::_getPage($dataUrl); |
|
| 97 | $phpArray = Helper\Json::decode($jsonData, true); |
|
| 98 | ||
| 99 | return isset($phpArray[0]['total_posts']) ? intval($phpArray[0]['total_posts']) : parent::noDataDefaultValue(); |
|
| 100 | } |
|
| 101 | ||
| 102 | /** |
|
| 103 | * Returns the Top10 tags for $url from Delicious. |
|
| @@ 206-215 (lines=10) @@ | ||
| 203 | * @param url string The URL to check. |
|
| 204 | * @return integer Returns the total count of URL shares. |
|
| 205 | */ |
|
| 206 | public static function getVKontakteShares($url = false) |
|
| 207 | { |
|
| 208 | $url = parent::getUrl($url); |
|
| 209 | $dataUrl = sprintf(Config\Services::VKONTAKTE_INFO_URL, urlencode($url)); |
|
| 210 | ||
| 211 | $htmlData = parent::_getPage($dataUrl); |
|
| 212 | @preg_match_all('#^VK\.Share\.count\(1, (\d+)\);$#si', $htmlData, $matches); |
|
| 213 | ||
| 214 | return isset($matches[1][0]) ? intval($matches[1][0]) : parent::noDataDefaultValue(); |
|
| 215 | } |
|
| 216 | ||
| 217 | /** |
|
| 218 | * Returns an array of interaction counts (shares, comments, clicks, reach) for host of $url on Xing. |
|