Code:
[COLOR=#000000][COLOR=#0000bb]<?php
$root[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]$_SERVER[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'DOCUMENT_ROOT'[/COLOR][COLOR=#007700]];
[/COLOR][COLOR=#ff8000]//The keywords file needs to be writeable
[/COLOR][COLOR=#0000bb]$keywordsFile[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]FILE_KEYWORDS[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#ff8000]//This will remove any keywords from contain in the file below
//both values must be set.
[/COLOR][COLOR=#0000bb]$badKeywordsFile[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]"$root/admin/badkeywords.txt"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000bb]$removeAdult[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#ff8000]//This file will include all keywords that have been scraped,
//so that we only scrape it once
[/COLOR][COLOR=#0000bb]$scrapedFile[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]"$root/scrapedKeywords.txt"[/COLOR][COLOR=#007700];
if(![/COLOR][COLOR=#0000bb]file_exists[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$scrapedFile[/COLOR][COLOR=#007700])) {
[/COLOR][COLOR=#0000bb]$fh [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]fopen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$scrapedFile[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]'w+'[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]fclose[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$fh[/COLOR][COLOR=#007700]);
}
[/COLOR][COLOR=#0000bb]$keysize[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]filesize[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$keywordsFile[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]$maxsize[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]35000[/COLOR][COLOR=#007700];
if ([/COLOR][COLOR=#0000bb]$keysize[/COLOR][COLOR=#007700]<=[/COLOR][COLOR=#0000bb]$maxsize[/COLOR][COLOR=#007700]) { [/COLOR][COLOR=#ff8000]//if the file size is larger than 35000 bytes (approx 2000 keywords), don't do anything
//The cookie.txt file needs to be writeable
[/COLOR][COLOR=#0000bb]$cookiePath[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]"$root/cookie.txt"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#ff8000]//Get the existing keywords
[/COLOR][COLOR=#0000bb]$existingKeywords[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]array_map[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]'rtrim'[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]file[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$keywordsFile[/COLOR][COLOR=#007700]));
[/COLOR][COLOR=#0000bb]$finishedKeywords[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]array_map[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]'rtrim'[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]file[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$scrapedFile[/COLOR][COLOR=#007700]));
[/COLOR][COLOR=#ff8000]//this is basically copied from the index page because hooks get called before this.
//there is probably a better way to do this without repeating the code.
[/COLOR][COLOR=#007700]if([/COLOR][COLOR=#0000bb]FOLDER [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000bb]true[/COLOR][COLOR=#007700]){
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb]$requested_page [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]str_replace[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]FOLDERNAME[/COLOR][COLOR=#007700],[/COLOR][COLOR=#dd0000]""[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$_SERVER[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'REQUEST_URI'[/COLOR][COLOR=#007700]]);
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb]$requested_page = [/COLOR][COLOR=#0000bb]str_replace[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]'.php'[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]''[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$requested_page[/COLOR][COLOR=#007700]);
} else{
[/COLOR][COLOR=#ff8000]// Thanks to ngkong for the fix
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb]$requested_page = [/COLOR][COLOR=#0000bb]$_SERVER[/COLOR][COLOR=#007700][[/COLOR][COLOR=#dd0000]'REQUEST_URI'[/COLOR][COLOR=#007700]];
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb]$requested_page = [/COLOR][COLOR=#0000bb]str_replace[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]'.php'[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]''[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$requested_page[/COLOR][COLOR=#007700]);
}
switch([/COLOR][COLOR=#0000bb]$requested_page[/COLOR][COLOR=#007700]) :
[/COLOR][COLOR=#0000bb] case [/COLOR][COLOR=#dd0000]'/'[/COLOR][COLOR=#007700]:
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb]$base_keyword[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]strtolower[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$existingKeywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700]]);
[/COLOR][COLOR=#0000bb] break;
[/COLOR][COLOR=#0000bb] case [/COLOR][COLOR=#dd0000]'/sitemap.html'[/COLOR][COLOR=#007700]:
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb]$base_keyword[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]''[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000bb] break;
[/COLOR][COLOR=#0000bb] case [/COLOR][COLOR=#dd0000]'/sitemap'[/COLOR][COLOR=#007700]:
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb]$base_keyword[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]''[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000bb] break;
[/COLOR][COLOR=#0000bb] case [/COLOR][COLOR=#dd0000]'/sitemap.php'[/COLOR][COLOR=#007700]:
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb]$base_keyword[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]''[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000bb] break;
[/COLOR][COLOR=#0000bb] default:
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb]$base_keyword[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]ucwords[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]strtolower[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]htmlentities[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]trim[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]str_replace[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"/"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]" "[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]str_replace[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"-"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]" "[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$requested_page[/COLOR][COLOR=#007700]))))));
endswitch;
[/COLOR][COLOR=#ff8000]//end code from the index page
//if we've scraped this keyword before, skip it
[/COLOR][COLOR=#007700]if ([/COLOR][COLOR=#0000bb]in_array[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$base_keyword[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$finishedKeywords[/COLOR][COLOR=#007700])) {
[/COLOR][COLOR=#0000bb]$base_keyword[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]''[/COLOR][COLOR=#007700];
}
if ([/COLOR][COLOR=#0000bb]$base_keyword[/COLOR][COLOR=#007700]!=[/COLOR][COLOR=#dd0000]''[/COLOR][COLOR=#007700]) {
[/COLOR][COLOR=#ff8000]//scrape google
[/COLOR][COLOR=#0000bb]$scrape_keyword[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]str_replace[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]" "[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"+"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$base_keyword[/COLOR][COLOR=#007700]); [/COLOR][COLOR=#ff8000]//urlencode seemed to work funny, and this seems to provide more relevent results
[/COLOR][COLOR=#0000bb]$url[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]"https://adwords.google.com/select/VariationsTool?adgroupid=0&campaignid=0&keywords="[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]$scrape_keyword[/COLOR][COLOR=#007700].[/COLOR][COLOR=#dd0000]"&adgroupIntegrated=false&skipLogin=true¤cyCode=USD&maxCpcOverride=100&targetLanguages=en&targetCountries=US&synonyms=true&nocache="[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]time[/COLOR][COLOR=#007700]();
[/COLOR][COLOR=#0000bb]$regex[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]"/kpCriterion\('([\w\s]+?)'/"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000bb]$results[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]curl[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$url[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$cookiePath[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]preg_match_all[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$regex[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$results[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$matches[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]$scrapedKeywords[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]$matches[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700]];
[/COLOR][COLOR=#ff8000]//discover which keywords are not already in the keywords file
[/COLOR][COLOR=#0000bb]$newKeywords[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]array_diff[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$scrapedKeywords[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$existingKeywords[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#ff8000]//remove nasty keywords
[/COLOR][COLOR=#007700]if([/COLOR][COLOR=#0000bb]file_exists[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$badKeywordsFile[/COLOR][COLOR=#007700]) && [/COLOR][COLOR=#0000bb]$removeAdult[/COLOR][COLOR=#007700]==[/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700]) {
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb]$badkeywords [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]file_get_contents[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$badKeywordsFile[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb]$nasty [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]explode[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"\n"[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$badkeywords[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb]$nastyCount [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]count[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$nasty[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb]$keywordCount [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]count[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$newKeywords[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb] for ([/COLOR][COLOR=#0000bb]$k[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000bb]$k[/COLOR][COLOR=#007700]<[/COLOR][COLOR=#0000bb]$keywordCount[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000bb]$k[/COLOR][COLOR=#007700]++){
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb] for ([/COLOR][COLOR=#0000bb]$l[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000bb]$l[/COLOR][COLOR=#007700]<[/COLOR][COLOR=#0000bb]$nastyCount[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000bb]$l[/COLOR][COLOR=#007700]++){
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb] if ([/COLOR][COLOR=#0000bb]stristr[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$newKeywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$k[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000bb]$nasty[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$l[/COLOR][COLOR=#007700]])){
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb] unset([/COLOR][COLOR=#0000bb]$newKeywords[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]$k[/COLOR][COLOR=#007700]]);
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb] }
[/COLOR][COLOR=#0000bb] [/COLOR][COLOR=#0000bb] }
[/COLOR][COLOR=#0000bb] }
}
[/COLOR][COLOR=#ff8000]//Append the new keywords
[/COLOR][COLOR=#0000bb]$mergedKeywords[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]array_merge[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$existingKeywords[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$newKeywords[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]$mergedKeywords[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]array_unique[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$mergedKeywords[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#ff8000]//Convert the keywords to a string
[/COLOR][COLOR=#0000bb]$textKeywords[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]strtolower[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]implode[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"\n"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$mergedKeywords[/COLOR][COLOR=#007700]));
[/COLOR][COLOR=#ff8000]//Write the all of the keywords to the keywords file
[/COLOR][COLOR=#0000bb]$fh[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]fopen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$keywordsFile[/COLOR][COLOR=#007700],[/COLOR][COLOR=#dd0000]'w+'[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]fwrite[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$fh[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$textKeywords[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]fclose[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$fh[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#ff8000]//Append the scraped keyword
[/COLOR][COLOR=#0000bb]array_push[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$finishedKeywords[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$base_keyword[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]$finishedKeywords [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]array_unique[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$finishedKeywords[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#ff8000]//Convert the keywords to a string
[/COLOR][COLOR=#0000bb]$textScraped[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]strtolower[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]implode[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"\n"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$finishedKeywords[/COLOR][COLOR=#007700]));
[/COLOR][COLOR=#ff8000]//Write the keyword to the scraped file
[/COLOR][COLOR=#0000bb]$fh[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]fopen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$scrapedFile[/COLOR][COLOR=#007700],[/COLOR][COLOR=#dd0000]'w+'[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]fwrite[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$fh[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$textScraped[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]fclose[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$fh[/COLOR][COLOR=#007700]);
}
}
function [/COLOR][COLOR=#0000bb]curl[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$url[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]$cookiePath[/COLOR][COLOR=#007700]) {
if(![/COLOR][COLOR=#0000bb]file_exists[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$cookiePath[/COLOR][COLOR=#007700])) {
[/COLOR][COLOR=#0000bb]$fh [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]fopen[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$cookiePath[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]'w+'[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]fclose[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$fh[/COLOR][COLOR=#007700]);
}
[/COLOR][COLOR=#0000bb]$user_agent[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#dd0000]"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; DigExt; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000bb]$ch [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]curl_init[/COLOR][COLOR=#007700]();
[/COLOR][COLOR=#0000bb]curl_setopt[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$ch[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]CURLOPT_URL[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$url[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]curl_setopt[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$ch[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]CURLOPT_REFERER[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$url[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]curl_setopt[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$ch[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]CURLOPT_USERAGENT[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$user_agent[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]curl_setopt[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$ch[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]CURLOPT_RETURNTRANSFER[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]true[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]curl_setopt[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$ch[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]CURLOPT_FOLLOWLOCATION[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]true[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]curl_setopt[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$ch[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]CURLOPT_COOKIEJAR[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$cookiePath[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]curl_setopt[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$ch[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]CURLOPT_COOKIEFILE[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]$cookiePath[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#ff8000]//if ($this->proxy) {
//curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true);
//curl_setopt($ch, CURLOPT_PROXY, $this->proxy_ip.":".$this->proxy_port);
//}
[/COLOR][COLOR=#0000bb]$output [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000bb]curl_exec[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$ch[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000bb]curl_close[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]$ch[/COLOR][COLOR=#007700]);
return [/COLOR][COLOR=#0000bb]$output[/COLOR][COLOR=#007700];
}
[/COLOR][COLOR=#0000bb]?>[/COLOR][/COLOR]