Facebook
From Eratic Coyote, 5 Years ago, written in PHP.
Embed
Download Paste or View Raw
Hits: 233
  1.  
  2.     for ($i = 1; $i < count($ad_counter); $i++) {
  3.         $c_url = curl_init();
  4. curl_setopt($c_url, CURLOPT_URL, "https:/example.com/page=".$i);
  5.         curl_setopt($c_url, CURLOPT_FOLLOWLOCATION, 1);
  6.         curl_setopt($c_url, CURLOPT_RETURNTRANSFER, 1);
  7.         curl_setopt($c_url, CURLOPT_POST, 0);  
  8.         curl_setopt($c_url, CURLOPT_RETURNTRANSFER, 1);
  9.         curl_setopt($c_url, CURLOPT_COOKIEFILE, "cookie.txt");    
  10.         $response = (curl_exec($c_url));
  11.         curl_close($c_url);
  12.  
  13.         $html = new simple_html_dom();
  14.         $html -> load($response);
  15.  
  16.          foreach($html->find('div.zi2') as $an){
  17.             $item['id'] = $an->find('input.checkbox', 0)->value;
  18.             $ans[] = $item;
  19.            
  20.               }
  21. }