Answer Matty
Long Tail Keyword Search

Plugin Development


Available JS Variables
allKeywordsUnique array of all found keywords on page, this will not have duplicates
searchTermTerm searched for by user
regionCodeGoogle format region/country code
languageCodeLanuage that is being searched

There is a plug element after each result provided for you to place your output.

if (typeof allKeywords == 'undefined') {
	console.log('NOT plugable page');
} else {
	console.log('IS plugable page');
}
Some Sample Code
Sample URLs

https://answermatty.com/s/a4287-82124-d8287

Other results pages may exist, or be added in the future, such as:
https://answermatty.com/s/a4287-82124-d8287/History
or with any similar URL:
https://answermatty.com/s/a4287-82124-d8287/*

If the allKeywords javascript variable exists and has content, it is a plugin appropriate page.

Copy this code into your browser console to see the results

console.log(searchTerm); // String: search term
console.log(allKeywords); // Array: unique list of all results
console.log(regionCode); // String: region code
console.log(languageCode); // String: language code

// Output all keywords on page
$('plug').each(function( index ) {
	console.log(this.keyword);
});

// Create an element for each search result
$('plug').each(function( index ) {
	// Use a child div so it doesn't influence anyone else's extensions/plugins and theirs don't influence ours
	var a = document.createElement("a");
	a.innerHTML = (this.keyword.length * 100).toLocaleString();
	a.setAttribute('class', 'HappyPluginProvider');
	a.setAttribute('href', 'https://google.com/search?q=' + encodeURIComponent(this.keyword + ' and mangoes'));
	a.setAttribute('target', '_blank');
	this.appendChild(a);
	// console.log(this.keyword);
});

// Add a button to the pluginButton area

var a = document.createElement("a");
a.innerHTML = "Run Our Thingy";
a.setAttribute('class', 'roundButton');
a.setAttribute('onclick', 'javascript:alert("boo!"); void 0;');
$('pluginButtons')[0].appendChild(a);

// Add some text output up in the header area

$('pluginWhatever').append('<div class="leftAlign" style="max-width: 500px; background: #f9f9f9; color: #111; padding: 3px; border-radius: 5px;">Spider Plugin processed:<br>'+allKeywords.length.toLocaleString()+' keywords</div>');
Form Processing!