|
|
@ -357,26 +357,29 @@ foreach ($db->getHostPageCrawlQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECOND |
|
|
|
$httpRequestsTimeTotal += $curl->getTotalTime(); |
|
|
|
$httpRequestsTimeTotal += $curl->getTotalTime(); |
|
|
|
|
|
|
|
|
|
|
|
// Update page rank |
|
|
|
// Update page rank |
|
|
|
// @TODO add common method |
|
|
|
if (CRAWL_PAGE_RANK_UPDATE) { |
|
|
|
|
|
|
|
|
|
|
|
$hostPageRank = 0; |
|
|
|
// @TODO add common method |
|
|
|
|
|
|
|
|
|
|
|
// Get referrers |
|
|
|
$hostPageRank = 0; |
|
|
|
foreach ($db->getHostPagesToHostPageByHostPageIdTarget($queueHostPage->hostPageId) as $hostPageToHostPageByHostPageIdTarget) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get source page details |
|
|
|
// Get referrers |
|
|
|
if ($hostPageSource = $db->getHostPage($hostPageToHostPageByHostPageIdTarget->hostPageIdSource)) { |
|
|
|
foreach ($db->getHostPagesToHostPageByHostPageIdTarget($queueHostPage->hostPageId) as $hostPageToHostPageByHostPageIdTarget) { |
|
|
|
|
|
|
|
|
|
|
|
// Increase PR on external referrer only |
|
|
|
// Get source page details |
|
|
|
if ($hostPageSource->hostId != $queueHostPage->hostId) { |
|
|
|
if ($hostPageSource = $db->getHostPage($hostPageToHostPageByHostPageIdTarget->hostPageIdSource)) { |
|
|
|
|
|
|
|
|
|
|
|
$hostPageRank++; |
|
|
|
// Increase PR on external referrer only |
|
|
|
} |
|
|
|
if ($hostPageSource->hostId != $queueHostPage->hostId) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$hostPageRank++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Delegate page rank value from redirected pages |
|
|
|
// Delegate page rank value from redirected pages |
|
|
|
if (false !== strpos($hostPageSource->httpCode, '30')) { |
|
|
|
if (false !== strpos($hostPageSource->httpCode, '30')) { |
|
|
|
|
|
|
|
|
|
|
|
$hostPageRank += $hostPageSource->rank; |
|
|
|
$hostPageRank += $hostPageSource->rank; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|