<?
// by Diego Garrido de Almeida
// garridez@gmail.com
class FileSonic extends Surf{
public function __construct($query){
parent::__construct($query);
$this->setDomain('filesonic.com');
}
public function stripFile($row){
$line = $this->getField($row);
$file = new stdClass();
// get name
preg_match_all('/Filename\:(.*?)(\.+[ ]|[ ]+\.)/', $line->nodeValue, $match);
$file->name = utf8_decode(($match[1][0]));
// get size
preg_match_all('/File size\:(.*?)(\.+[ ]|[ ]+\.)/', $line->nodeValue, $match);
$file->size = utf8_decode(($match[1][0]));
// get size
preg_match_all('/Description\:(.*?) (Share|High)/', $line->nodeValue, $match);
$file->description = utf8_decode(($match[1][0]));
// get link
$file->link = $row->getElementsByTagName('h3')->item(0)->getElementsByTagName('a')->item(0)->getAttribute('href');
return $file;
}
}
?>
|