Login   Register  
PHP Classes
elePHPant
Icontem

File: library/class.surf.megaupload.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Diego Garrido de Almeida  >  Google File Finder  >  library/class.surf.megaupload.php  >  Download  
File: library/class.surf.megaupload.php
Role: Class source
Content type: text/plain
Description: MegaUpload Example Class
Class: Google File Finder
Search for files in sites using Google
Author: By
Last change:
Date: 2010-11-06 22:14
Size: 1,176 bytes
 

Contents

Class file image Download
<?
// 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;
         }
}

?>