Black Hat Forum Black Hat SEO The only backlink provider with unlimited projects/links per day!
Go Back   Black Hat Forum Black Hat SEO > Making Money > Pay Per View

Pay Per View PPV - learn how to have your ads popup on computers infected with adware.

Mad Content   BLOG SEO
Search
 
LinkWheel

LiveChatAgent



Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-30-2009, 02:30 PM
StackingDough's Avatar
Newbies
 
Join Date: Dec 2009
Posts: 12
Thanks: 8
Thanked 40 Times in 5 Posts
Reputation: 7
iTrader: (0)
Send a message via Yahoo to StackingDough
Lightbulb PPV SE Scraper

Modify to fit your own needs (proxies, url length, pages scraped etc), enjoy.


Code:
   <?php
class scraper
{
    var $ch;
    var $result;
    
    function __construct(){}
    
    private function init()
    {    
        $ch = curl_init();
        $this->ch = $ch;
        
        $agent = array(    'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6',
                        'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)',
                        'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)',
                        'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
                        'Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 5.1; .NET CLR 1.1.4322)',
                        'Opera/9.20 (Windows NT 6.0; U; en)',
                        'Opera/9.00 (Windows NT 5.1; U; en)',
                        'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.50',
                        'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.0',
                        'Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.1) Opera 7.02 [en]',
                        'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20060127 Netscape/8.1' );
                    
        shuffle($agent);
                
        curl_setopt($this->ch,CURLOPT_RETURNTRANSFER,1);
        curl_setopt($this->ch,CURLOPT_FOLLOWLOCATION,1);
        curl_setopt($this->ch,CURLOPT_USERAGENT,$agent[0]);
        curl_setopt($this->ch,CURLOPT_TIMEOUT,10);
        curl_setopt($this->ch,CURLOPT_******SESSION,1);
        curl_setopt($this->ch,CURLOPT_SSL_VERIFYHOST,0);
        curl_setopt($this->ch,CURLOPT_SSL_VERIFYPEER,0);
        
        return;
    }
    
    private function get($url)
    {
        curl_setopt($this->ch,CURLOPT_URL,$url);
        curl_setopt($this->ch,CURLOPT_POST,0);
        
        $s = curl_exec($this->ch);

        return $s;        
    }
    
    /* parse related */
    private function parse_all($source,$tag1,$tag2)
    {
        $source=str_replace($tag1,'<tiny:parse>',$source);
        $source=str_replace($tag2,'</tiny:parse>',$source);
        
        preg_match_all('#<tiny:parse>(.*?)</tiny:parse>#',$source,$result);

        return($result[1]);        
    }
    
    function go($keyword)
    {
        $this->init();
        
        $start = 0; while($start<200)
        {
            $s = $this->get('google.com/search?hl=en&q='.urlencode($keyword).'&start='.$start.'&sa=N');
            $urls = $this->parse_all($s,'<h3 class=r><a href="','" class=l>');

            if(is_array($urls) && count($urls)>0)
            {
                foreach($urls as $url)
                {
                    if(strlen($url)>40) $fin[] = $url;
                }
            }
            
            $start = $start + 10;
        }
        
        array_unique($fin);
        
        foreach($fin as $result) echo $result.'<br />';
    }
}

$q = $_GET['q'];

if(trim($q)=='')
{
    echo 'You must provide a query';
}else{
    $scr = new scraper();
    $scr->go($q);
}
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 2 Users Say Thank You to StackingDough For This Useful Post:
fear91 (12-30-2009), lenhan555 (12-30-2009)
  #2 (permalink)  
Old 12-30-2009, 02:42 PM
fear91's Avatar
Regular Member
 
Join Date: Dec 2007
Posts: 359
Thanks: 55
Thanked 83 Times in 67 Posts
Reputation: 11
iTrader: (0)
Default Re: PPV SE Scraper

Good Share!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-30-2009, 04:18 PM
fistuk's Avatar
Newbies
 
Join Date: Dec 2008
Posts: 23
Thanks: 20
Thanked 68 Times in 10 Posts
Reputation: 10
iTrader: (0)
Default Re: PPV SE Scraper

Thanks a lot for the share.

Not that I care but why reinvent the wheel?
Laser URL is such a great tool and free...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-30-2009, 09:32 PM
terebl7's Avatar
Newbies
 
Join Date: Jul 2009
Posts: 11
Thanks: 4
Thanked 1 Time in 1 Post
Reputation: 10
iTrader: (0)
Default Re: PPV SE Scraper

how can i use it? thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
ppv se scraper , scrape urls , scraper

Backlinks Genie

SE Nuke



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


SEO Paladin


Web Hosting
Copyright © 2005 - 2012 BlackHatWorld.com All rights reserved.