
magog - 2012-04-05 19:41:17 -
In reply to message 1 from M C P
Hi!
For example:
####################
<?php
/*... some code ...*/
// Create CContentDopwnlopader instance
$contRecivier = new CContentDownloader();
// Get contents of all pages
foreach($pages as $k => $page){
$uri = $page['host'].$page['uri'];
// Add source & remember index in stack
$pages[$k]['uri_id'] = $contRecivier->addSource($uri);
}
// Get contents of requested url`s
$contents = $contRecivier->getContents()
// Proccess contents
if($contents)
foreach ($pages as $k => $page){
if(
isset($contents[$page['uri_id']]) &&
is_array($contents[$page['uri_id']]) &&
$contents[$page['uri_id']]['error'] === false
){
$content = $contents[$page['uri_id']];
/* ... do something with content */
} else {
/* proccess error */
}
/*... some code ...*/
?>
####################
With best reguards :)