[Ищу] Посоветуйте серверный парсер Google Adwords

Тема в разделе "SEO Скрипты", создана пользователем n00b, 10 янв 2007.

Статус темы:
Закрыта.
  1. n00b

    n00b Прохожие

    Посоветуйте серверный парсер ключевых слов Google Adwords

    Перерыл весь инет, нашёл только retrieve.pl у Гринвуда и то работает через попу :(
     
  2. imeanamail

    imeanamail Прохожие

    есть только база на 44м напарсенная уже.. публичных парсеров в природе точно нет.
     
  3. alexzh

    alexzh

    Регистр.:
    13 сен 2006
    Сообщения:
    222
    Симпатии:
    88
    retrieve-sources.rar retrieve.pl
    retrieve.rar retrieve.exe(под винду) работает но парcит овертюру а не adwords

    есть в продаже только ;-)

    вот тут есть кусок кода который дергает кеи из эдвордс
    http://www.syndk8.net/YACG-yet-another-content-generator.html
     
  4. n00b

    n00b Прохожие

    Вот и хорошо, а сколько стоит и как называется?
     
  5. alexzh

    alexzh

    Регистр.:
    13 сен 2006
    Сообщения:
    222
    Симпатии:
    88
    не скрипт, вроде есть только база о которой уже упомянули выше на 44м напарсенная уже о которой гринвуд писал http://bloggreenwood.com/weblog/P4921/ и не только
     
  6. cashmaniac

    cashmaniac Постоялец

    Регистр.:
    12 янв 2007
    Сообщения:
    64
    Симпатии:
    5
    они там парсят чепопало, ценный линк :)
    но адвордз не нашел :(

    можешь плз сюда кинуть тот кусок кода, если есть?
     
  7. alexzh

    alexzh

    Регистр.:
    13 сен 2006
    Сообщения:
    222
    Симпатии:
    88
    линк перепутал немного вот код
    Keyword Scraping Hook
    Код:
    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&currencyCode=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]
     
    alexz, cashmaniac, filler00 и 2 другим нравится это.
  8. vikolon

    vikolon Постоялец

    Регистр.:
    22 сен 2006
    Сообщения:
    109
    Симпатии:
    17
    такое у kiwi на блоге встречал-
    <?
    //
    function getadwords ( $keyword, &$err = 1 )
    {
    global $proxy;

    $ch = curl_init();
    // curl_setopt($ch, CURLOPT_URL,'https://adwords.google.com/select/VariationsTool?adgroupid=0&campaignid=0&keywords='
    . urlencode ($keyword) .
    '&adgroupIntegrated=false&skipLogin=true&currencyCode=USD&maxCpcOverride=&targetLanguages=en&targetCountries=*&synonyms=true&nocache=1146820018203');
    curl_setopt($ch, CURLOPT_URL,'https://adwords.google.com/select/VariationsTool?adgroupid=0&campaignid=0&keywords=' .
    urlencode ($keyword) .
    '&adgroupIntegrated=false&skipLogin=true&currencyCode=USD&maxCpcOverride=&targetLanguages=es&targetCountries=*&synonyms=true&nocache=1146820018203');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch, CURLOPT_FAILONERROR, 1);
    curl_setopt($ch, CURLOPT_COOKIEJAR, './cc-adwords.txt');
    curl_setopt($ch, CURLOPT_COOKIEFILE, './cc-adwords.txt');
    curl_setopt($ch, CURLOPT_REFERER, "http://adwords.google.com");
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET');
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 60);
    $randproxy = rand (0, count ($proxy) - 1);
    curl_setopt($ch, CURLOPT_PROXY, $proxy [$randproxy]);
    $html = curl_exec ($ch);
    $succeeded = curl_errno($ch) == 0 ? true : false;
    $err = curl_errno($ch).':'.curl_error($ch);
    if(!$succeeded)
    {
    print '- [' . $keyword . '] (' . $err . ")\n";
    unset ($proxy [$randproxy]);
    $err = 1;
    } else
    {
    print '+ [' . $keyword . ']' . "\n";
    $err = 0;
    }
    preg_match_all ('/criteria\.push\(new kpCriterion\(\'([\w\s]+)\', /is', $html, $match_all);
    return ($match_all [1]);

    curl_close ( $ch );
    }

    $proxy = array ();
    $fi = fopen ('tut-url-otkuda-brat-proxy', 'r');
    if (! $fi)
    {
    print '- cannot open proxy ' . "\n";
    die;
    }
    while (!feof ($fi))
    {
    $proxy [] = trim (fgets ($fi, 4096));
    }
    fclose ($fi);

    $proxy = array_slice ($proxy, 0, 100);
    print '* proxy: ' . count ($proxy) . ' - ' . $proxy [0] . "\n";

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,"https://adwords.google.com/");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch, CURLOPT_FAILONERROR, 1);
    curl_setopt($ch, CURLOPT_COOKIEJAR, './cc-adwords.txt');
    curl_setopt($ch, CURLOPT_COOKIEFILE, './cc-adwords.txt');
    curl_setopt($ch, CURLOPT_REFERER, "http://www.google.com");
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET');
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 60);
    $html = curl_exec ($ch);
    $succeeded = curl_errno ($ch) == 0 ? true : false;
    $err = curl_errno ($ch) . ':' . curl_error ($ch);
    if(!$succeeded)
    {
    print $err;
    }
    curl_close ($ch);

    $keywords = array ();
    $skeywords = array ('telefono', 'negocio');

    $err = 0;

    foreach ($skeywords as $skeyword)
    {
    $bkeywords = getadwords ( $skeyword, $err );

    $i = 0;
    while ($err == 1 && $i < 4)
    {
    $bkeywords = getadwords ( $skeyword, $err );
    $i ++ ;
    }

    foreach ($bkeywords as $keyword)
    {
    $keywords [$keyword] = $keyword;
    $akeywords = getadwords ( $keyword );

    foreach ($akeywords as $keyword)
    {
    $keywords [$keyword] = $keyword;
    }

    print '* ' . $i . '=' . count ($keywords) . "\n";
    }
    }

    $fo = fopen ('./adwords-es.txt', 'a+');
    foreach ($keywords as $keyword)
    {
    fputs ($fo, $keyword . "\n");
    }
    fclose ($fo);

    print '+ ' . count ($keywords) . "\n";
    ?>
     
  9. Jenni

    Jenni Прохожие

  10. cashmaniac

    cashmaniac Постоялец

    Регистр.:
    12 янв 2007
    Сообщения:
    64
    Симпатии:
    5
    Staratel нравится это.
Статус темы:
Закрыта.