<?
// by Diego Garrido de Almeida
// garridez@gmail.com
class MegaUpload extends Surf{
public function __construct($query){
parent::__construct($query);
$this->setDomain('megaupload.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('/File description\: (.*?) File size/', $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;
}
}
?>
|