require('CURL.php');
class Blogs_last_post extends CURL{
private $_result;
/*private $listeImages = array(
0 => 0, // penelope
1 => 12, //explosm
2 => 0, // margaux
);
private $nomImages = array(
0 => 'PenelopeBagieu',
1 => 'CyanideAndHapiness',
2 => 'MargauxMotin',
);
public $link = array(
0 => 'http://www.penelope-jolicoeur.com/',
1 => 'http://www.explosm.net/comics/',
2 => 'http://margauxmotin.typepad.fr/',
);*/
private $link = array();
function getResult()
{
return $this->_result;
}
public function getLinks(){
if($linksXML = simplexml_load_file('../db/blog_links.xml')){
foreach($linksXML->link as $individualLink){
$this->link[] = array('name'=>$individualLink->name, 'url'=>$individualLink->url, 'number'=>$individualLink->number);
}
return $this->link;
}
else
return;
}
function getTitles()
{
$xhtml = "";
try{
foreach($this->exec() as $result)
{
$xhtml .= $this->getTitle($result);
$xhtml .= '
';
}
}catch(Exception $e)
{
$xhtml .= $this->error();
}
return $xhtml;
}
function getTitle($result = null, $url = null)
{
if(isset($result))
{
preg_match( "/