1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[GET][SCRIPT] Google Suggest Keyword Scraper

Discussion in 'Black Hat SEO Tools' started by buzzcore, Mar 9, 2014.

  1. buzzcore

    buzzcore Junior Member

    Joined:
    Apr 7, 2013
    Messages:
    172
    Likes Received:
    47
    Hey guys,

    I made this a while ago and have been using it to generate big lists of keywords based on Google search suggest. Here is an example of what it does...

    [​IMG]

    Will generate up to 6,760 keywords with this phrase in front of it like so...

    Code:
    [COLOR=#ffffff][FONT=arial][SIZE=2]how to write aaron in arabic
    how to write aaron in chinese
    how to write aaliyah in arabic
    how to write aaron in japanese
    how to write aahil in urdu
    how to write ashirwad in hindi
    how to write aaron in hebrew
    how to write aa degree on resume
    ...
    (6,000 more results here)
    ..
    how to write zubair in arabic
    how to write chi in chinese
    how to write zuko in chinese
    how to write zu in japanese keyboard
    how to write on your zwinky profile
    how to write your name on zwinky
    how to write zx spectrum games
    how to write a zx spectrum emulator
    how to write zynga
    how to write to zynga support
    how to write email to zynga
    how to write a complaint to zynga
    how do you write to zynga
    how to write a letter to zynga
    how to write a message to zynga
    how to write a prescription for zyban[/SIZE][/FONT][/COLOR]
    The script is as follows, make it a php file and upload it to your server. One word of warning though, I'm sure if you spam this script a lot every day Google will ban your IP, so use it sparingly. I have used it once a day since I made it and I havn't been hit with an IP ban yet.

    Code:
    [COLOR=#ffff00]<?php
    if (isset($_POST["keyword"]) && $_POST['keyword'] !== "") {    
    $alphas1 = range('A', 'Z');    
    $alphas2 = range('A', 'Z');    
    $keyword = $_POST['keyword'];    
    foreach ($alphas1 as $a1) {        foreach ($alphas2 as $a2) {            
    $xml = simplexml_load_file("http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=$keyword.' '.$a1.$a2");            
    foreach ($xml->children() as $child) {                               
    foreach ($child->suggestion->attributes() as $dta) {                                        
    echo "<br>";                    
    echo $dta;                                   
     }            }                    }    }} else {?>
    <form action="<?php    $_SERVER['PHP_SELF'];?>" method="post">Keyword: <input type="text" name="keyword"  required><input type="submit"></form>
    <?php}?>[/COLOR]
    Hope it is of some use to you all!:drinking2​
     
    • Thanks Thanks x 7
  2. M4XW3LL

    M4XW3LL Senior Member

    Joined:
    Feb 5, 2013
    Messages:
    1,052
    Likes Received:
    1,247
    Do the suggestions change depending on the IP (location) of the search?
     
  3. buzzcore

    buzzcore Junior Member

    Joined:
    Apr 7, 2013
    Messages:
    172
    Likes Received:
    47
    I'm not sure to be honest. However you can modify it for any language you want by changing the "hl=en" to hl={required 639-1 language code} http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes.
     
    • Thanks Thanks x 1
  4. knopper

    knopper Regular Member Premium Member

    Joined:
    Dec 24, 2008
    Messages:
    429
    Likes Received:
    188
    Occupation:
    Making Money
    Location:
    Pearl City
    Why don't you add proxy support to this script?
     
  5. Snckr

    Snckr BANNED BANNED

    Joined:
    Dec 27, 2013
    Messages:
    582
    Likes Received:
    381
    Didn't know about that, thank you.
     
  6. buzzcore

    buzzcore Junior Member

    Joined:
    Apr 7, 2013
    Messages:
    172
    Likes Received:
    47
    I never added proxy support for this as I never needed it. It would be quite a task to make this utilize proxies but I may look into it.
     
  7. blackjack

    blackjack Regular Member

    Joined:
    Nov 23, 2007
    Messages:
    276
    Likes Received:
    51
    I am getting error on last line. "Unexpected } line 14"
     
  8. Camelion

    Camelion Newbie

    Joined:
    Mar 9, 2014
    Messages:
    7
    Likes Received:
    2
    Thanks for this share!!:)
     
  9. TZ2011

    TZ2011 Senior Member

    Joined:
    Jun 26, 2011
    Messages:
    832
    Likes Received:
    863
    Occupation:
    Cleaning servers
    Some formatting issues (copy/paste code to forum) giving error in line 14. Try this

    Code:
    <?php
    if (isset($_POST["keyword"]) && $_POST['keyword'] !== "") {
    $alphas1 = range('A', 'Z');
    $alphas2 = range('A', 'Z');
    $keyword = $_POST['keyword'];
    foreach ($alphas1 as $a1) { foreach ($alphas2 as $a2) {
    $xml = simplexml_load_file( utf8_encode("http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=$keyword.' '.$a1.$a2"));
    foreach ($xml->children() as $child) {
    foreach ($child->suggestion->attributes() as $dta) {
    echo "<br>";
    echo $dta;
    }}}}
    } else {
    ?>
    <form action="<?php $_SERVER['PHP_SELF'];?>" method="post">Keyword: <input type="text" name="keyword" required><input type="submit"></form>
    <?php
    }
    ?>
    

    OP, you should check encoding, something with simplexml_load_file() is not ok, I have tried to push utf-8 with

    $xml = simplexml_load_file( utf8_encode("http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=$keyword.' '.$a1.$a2"));

    but still getting some error after results are printed. I am away of my working laptop now so can not test it further but just wanted to let you know. this is error

    Code:
    [B]Warning[/B]:  simplexml_load_file() [[URL="http://popupdevil.com/function.simplexml-load-file"]function.simplexml-load-file[/URL]]:   [URL]http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=story.'%20'.C.J:1:[/URL]  parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0x9A 0x61 0x76 0x61 in [B]/my domain here/GoogleSuggestKeywordScraper.php[/B] on line [B]7[/B]
    
    [B]Warning[/B]:  simplexml_load_file() [[URL="http://popupdevil.com/function.simplexml-load-file"]function.simplexml-load-file[/URL]]: 7"/></CompleteSuggestion><CompleteSuggestion><suggestion data="story cjenik ogla in [B][B]/my domain here[/B]/GoogleSuggestKeywordScraper.php[/B] on line [B]7[/B]
    
    [B]Warning[/B]:  simplexml_load_file() [[URL="http://popupdevil.com/function.simplexml-load-file"]function.simplexml-load-file[/URL]]:                                                                                ^ in [B]/my domain here/[/B][B]GoogleSuggestKeywordScraper.php[/B] on line [B]7[/B]
    
    [B]Fatal error[/B]:  Call to a member function children() on a non-object in [B][B]/my domain here/[/B]GoogleSuggestKeywordScraper.php[/B] on line [B]8[/B]
     
  10. buzzcore

    buzzcore Junior Member

    Joined:
    Apr 7, 2013
    Messages:
    172
    Likes Received:
    47

    Hi, yes simplexml_load_file can only parse utf-8. It seems that when the script for your search query "story" gets to "story cj" one of the results contains a non utf-8 character, and this is why it is giving this error. I will look into it when I have some free time.
     
  11. Oguzz14

    Oguzz14 Newbie

    Joined:
    Dec 16, 2014
    Messages:
    15
    Likes Received:
    0
    buzzcore,

    Thank you a lot for this tool bro, that looks really cool.
     
    Last edited: Dec 17, 2014
  12. Oguzz14

    Oguzz14 Newbie

    Joined:
    Dec 16, 2014
    Messages:
    15
    Likes Received:
    0
    I've opened a "Hire a Freelancer" project regarding to this post. I need a little customization. All are welcomed to it..

    It is: [h=2]"$20 For Quick Customization of "Google Suggest Keyword Scraper"[/h]
    in the "Hire a Freelancer" section.
     
  13. Oguzz14

    Oguzz14 Newbie

    Joined:
    Dec 16, 2014
    Messages:
    15
    Likes Received:
    0
    I wanted to post the job here as well:

    Hi,


    buzzcore, has made a great "google suggestions scraper" here: "search the forum for:"[GET][SCRIPT] Google Suggest Keyword Scraper"


    Thanks a lot again for what he has done and for sharing it here publicly. The code is shared in the post, too.

    What I need is: the shared script works for scraping suggestions in the "keyword + anyword" format, I mean it scrapes the search suggestions that are added afterthe entered keyword.

    I need a small change in the script and a small selection feature like "before keyword" or "after keyword" so that the script can do the same job for scraping suggestions in the "anyword + keyword" format. So it basically needs words creation engine before the keyword, as well. And the words can be more than 1.

    I need to do that because I want to scrape "..... .... treatment" keywords from google. Such keywords like:

    "asthma treatment"
    ...
    ...
    "herpes treatment"
    "hemorrhoids treatment"
    ...
    "knee pain treatment"
    ...
    ...
    "stress treatment"
    ...
    etc..

    I'll pay $20 for it. And I'll share it here in the bhw just like buzzcore so that everyone can benefit it.

    buzzcore himself is also welcomed to make the changes since it's his script he can do it faster than anybody I guess.

    The freelancer should make a scrape after the job and prove that it works.

    Please feel free to ask any questions if you don't understand anything.

    Thanks for reading.
     
  14. buzzcore

    buzzcore Junior Member

    Joined:
    Apr 7, 2013
    Messages:
    172
    Likes Received:
    47
    Unless someone can correct me I don't think this is possible. The tool works by taking your keyword, in your case "treatment" then appends 2 letters the the end of it by double iterating the alphabet. so it will ask google for suggestions on "treatment aa" then "treatment ab", "treatment ac"... through to "treatment zz".

    But, appending these letters to the start of the query will work. Asking google for suggestions on "kn treatment" will not bring up "knee treatment".

    There are programs that can help you, but they will cost you more than $20 no doubt. Wish I could help you out.

    All the best in your campaign!
    Buzz
     
    • Thanks Thanks x 1
  15. Oguzz14

    Oguzz14 Newbie

    Joined:
    Dec 16, 2014
    Messages:
    15
    Likes Received:
    0
    Hi buzzcore,

    Thanks for your reply.

    What programs do you mean exactly?