Created
June 13, 2013 09:44
-
-
Save jkaflik/5772510 to your computer and use it in GitHub Desktop.
Userscript which download suggested keywords according to your keywords array.
It uses https://adwords.google.com/o/Targeting
Usage:
Open https://adwords.google.com/o/Targeting , run core.js script, and then run.js (first or second version)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jq = document.createElement('script');jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js";document.getElementsByTagName('head')[0].appendChild(jq); | |
// Returns interval between next keywords suggestions download | |
// return value must be seconds (int) | |
// defaults: 15-30 seconds | |
var phraseInterval = function(){ | |
return ( Math.random + 1 ) * 15; | |
}; | |
var suggestedKeywordsOffset = 0; | |
var processKeywordSuggest = function(phrase){ | |
$(".sNFB").val(phrase); | |
$(".aw-native-save-button-element").click(); | |
setTimeout(function(){ | |
$(".gux-menu-button").parent().parent().parent().parent().parent().click(); | |
$(".sEQ").click(); | |
$(".aw-download-popup .goog-button-base-content").click(); | |
}, 2000 + 1000 * Math.random()); | |
return true; | |
} | |
var runKeywordsSuggest = function(){ | |
var captchaDisplay = $(".captcha-widget-container").css('display'); | |
if (captchaDisplay != 'none' || captchaDisplay == undefined || captchaDisplay == null){ | |
console.log("Waiting due captcha."); | |
setTimeout(runKeywordsSuggest, 2000); | |
return; | |
} | |
else | |
console.log("Keyword: " + suggestedKeywords[suggestedKeywordsOffset] + " (" + suggestedKeywordsOffset + ")"); | |
processKeywordSuggest(suggestedKeywords[suggestedKeywordsOffset]); | |
suggestedKeywordsOffset++; | |
if ( suggestedKeywordsOffset < suggestedKeywords.length ){ | |
setTimeout(runKeywordsSuggest, phraseInterval() ); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var suggestedKeywords = ['programming', 'javascript']; | |
runKeywordsSuggest(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var suggestedKeywords = []; | |
$.ajax({ | |
url: 'http://server/your_list.txt', | |
type: 'GET', | |
crossDomain: true, | |
success: function(input){ | |
suggestKeywords = input.split("\n"); | |
runKeywordsSuggest(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment