Login   Register  
PHP Classes
elePHPant
Icontem

File: library/class.surf.filesonic.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.filesonic.php  >  Download  
File: library/class.surf.filesonic.php
Role: Class source
Content type: text/plain
Description: FileSonic Example Class
Class: Google File Finder
Search for files in sites using Google
Author: By
Last change:
Date: 3 years ago
Size: 1,169 bytes
 

Contents

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

?>