View Single Post
Old 01-24-2009, 12:30 PM  
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by doridori View Post
you realize multiple tube sites have different layouts. your code failed.
I'm going to give you a lesson in PHP, which is to explain what Killswitch probably does.

PHP Code:
$tubes = array('redtube''pornhub''whatever');

$scrape = new Whatever;
foreach (
$tubes as $tube) {
    
$scrape->run($tube);

Then.

PHP Code:
class Whatever {
    public function 
run($tube) {
        
$path 'drivers/' $tube '.php';
        require_once 
$path;
        
$obj = new $tube;
        
$this->data[$tube] = $obj->crawl();
    }

Each individual driver would have the code necessary to scrape the "different layouts" you were speaking of. So, you should make sure you know what you're talking about when you laugh at someone for a method they use.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote