PHP Classes

How do I use this class ?

Recommend this page to a friend!

      Content downloader  >  All threads  >  How do I use this class ?  >  (Un) Subscribe thread alerts  
Subject:How do I use this class ?
Summary:How do I use this class ?
Messages:3
Author:M C P
Date:2012-04-05 12:40:31
Update:2012-04-05 19:41:16
 

  1. How do I use this class ?   Reply   Report abuse  
Picture of M C P M C P - 2012-04-05 12:40:31
How do I use this class ?

Got any sample Code ?

  2. Re: How do I use this class ?   Reply   Report abuse  
Picture of magog 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 :)

  3. Re: How do I use this class ?   Reply   Report abuse  
Picture of asdjhjhjh asdjhjhjh - 2015-09-08 19:29:33 - In reply to message 2 from magog
write the work parser!