This commit is contained in:
2016-02-07 17:13:58 +08:00
parent 1c1efc1da5
commit b3a059e78e
5 changed files with 127 additions and 92 deletions
+4 -3
View File
@@ -1,6 +1,6 @@
# Keywordshitter2 - The Bulk Keyword Tool # Keywordshitter2 - The Bulk Keyword Tool
An update of the beloved keyword generation tool [keywordshitter](keywordshitter.com). [Demo here](http://wassname.github.io/keywordshitter2/). An update of the beloved keyword generation tool keywordshitter.com. [Try it here.](http://wassname.github.io/keywordshitter2/).
#New features: #New features:
@@ -13,14 +13,15 @@ An update of the beloved keyword generation tool [keywordshitter](keywordshitter
- Shit theme - Shit theme
- Simple - Simple
- Humor suitable for a todler - Humor suitable for a toddler
- Cunningly lower user expectations to zero, then exceed them
## Coming soon (TM): ## Coming soon (TM):
- Multiple services - Multiple services
- Updated toilet logo - Updated toilet logo
- Less bugs - Less bugs
- CPC and Volume integration from KeywordKeg - CPC and Volume integration possibly
# License # License
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 59 KiB

+12 -9
View File
@@ -11,17 +11,15 @@
</head> </head>
<body> <body>
<a href="http://wassname.github.io/keywordshitter2/"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
<meta http-equiv="CACHE-CONTROL" content="NO-CACHE"> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<img class="center-block responsive img img-responsive img-rounded" style="max-height: 8em" src="img/bl.png"> <img class="center-block responsive img img-responsive img-rounded" style="max-height: 10em" src="img/bl.png">
</div> </div>
</div> </div>
@@ -38,7 +36,7 @@ on purpose
dismantled my dismantled my
lying internet</textarea> lying internet</textarea>
</div> </div>
<a class="btn btn-primary" id="startjob" onclick="StartJob();" type="button" value="Shit Keywords!">Shit Keywords!</a> <a class="btn btn-primary btn-lg" id="startjob" onclick="StartJob();" type="button" value="Shit Keywords!">Shit Keywords!</a>
<button class="btn btn-default" type="button" data-toggle="collapse" data-target="#advanced" aria-expanded="false" aria-controls="advanced"> <button class="btn btn-default" type="button" data-toggle="collapse" data-target="#advanced" aria-expanded="false" aria-controls="advanced">
@@ -48,7 +46,8 @@ lying internet</textarea>
<button class="btn btn-default" type="button" data-toggle="collapse" data-target="#about" aria-expanded="false" aria-controls="about"> <button class="btn btn-default" type="button" data-toggle="collapse" data-target="#about" aria-expanded="false" aria-controls="about">
About About
</button> </button>
<a class="btn btn-default" id="reset" onclick="reset();" type="button" value="CleResetar">Reset</a> <a class="btn btn-default" id="reset" title="Load cached data from previous sessions" onclick="loadFromDB();" type="button" value="load">Load cache</a>
<a class="btn btn-default" id="reset" title="Empty all input and results" onclick="reset();" type="button" value="Reset">Reset</a>
<!-- </div> --> <!-- </div> -->
<!-- <div class="col-sm-2"> --> <!-- <div class="col-sm-2"> -->
@@ -97,11 +96,14 @@ lying internet</textarea>
</form> </form>
<div id="about" class="collapse"> <div id="about" class="collapse">
<p>Keyword shitter 2 is inspired by the amazing Keyword shitter 1!</p> <p></p>
<p>Keyword shitter 2 is a bulk keyword finder based of the beloved keyword shitter. The tool is great for finding long tail keywords and cunningly lowered your expectations to zero, then manager to exceed them.</p>
<p>New features include: multiple services, sorting results, configurable keywords stemming, IndexDB storage, and some options.</p> <p>New features include: results table, sorting results, configurable keywords permutations, IndexDB storage, and more options.</p>
<p>But you will be glad to know we kept the same old shit name.</p> <p>But you will be relieved to know we kept the same old shit theme and toddler humor.</p>
<a href="https://github.com/wassname/keywordshitter2">More information on github.</a>
</div> </div>
</div> </div>
@@ -150,8 +152,9 @@ lying internet</textarea>
<script type="text/javascript" src="js/main.js"></script> <script type="text/javascript" src="js/main.js"></script>
<a href="https://github.com/wassname/keywordshitter2"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/652c5b9acfaddf3a9c326fa6bde407b87f7be0f4/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"></a>
<!-- Fork me on github... Do you get it? Do you! Oh um. Well they say the best jokes are the ones you have to explain. Or at least, I'm sure someone has said that, somewhere. I'll explain it for you, just for you. You know how in the matrix they say there is no spoon? Well there is no spooning is what I should out in the theature everytime! But don't worry you can fuck me on github, I mean fork. Think about it! I haven't. It makes sense now right? Erm. Well. Bye. -->
<a href="http://wassname.github.io/keywordshitter2/">Fork me on github</a>
</body> </body>
</html> </html>
+110 -80
View File
@@ -117,12 +117,11 @@ window.setInterval(DoJob, 750);
function StartJob() { function StartJob() {
if (doWork === false) { if (doWork === false) {
keywordsToDisplay = [];
hashMapResults = {}; hashMapResults = {};
keywordsToQuery = []; keywordsToQuery = [];
keywordsToQueryIndex = 0; keywordsToQueryIndex = 0;
// hashMapResults[""] = 1; hashMapResults[""] = 1;
// hashMapResults[" "] = 1; // hashMapResults[" "] = 1;
// hashMapResults[" "] = 1; // hashMapResults[" "] = 1;
@@ -134,17 +133,7 @@ function StartJob() {
var i = 0; var i = 0;
for (i = 0; i < ks.length; i++) { for (i = 0; i < ks.length; i++) {
keywordsToQuery[keywordsToQuery.length] = ks[i]; keywordsToQuery[keywordsToQuery.length] = ks[i];
// keywordsToDisplay[keywordsToDisplay.length] = {
// Keyword: ks[i]
// };
// var j = 0;
// for (j = 0; j < 26; j++) {
// var chr = String.fromCharCode(97 + j);
// var currentx = ks[i] + ' ' + chr;
// keywordsToQuery[keywordsToQuery.length] = currentx;
// hashMapResults[currentx] = 1;
// }
} }
numOfInitialKeywords = keywordsToQuery.length; numOfInitialKeywords = keywordsToQuery.length;
FilterAndDisplay(); FilterAndDisplay();
@@ -196,25 +185,25 @@ function permuteResultsToQueue(retList, search){
}); });
for (var i = 0; i < retList.length; i++) { for (var i = 0; i < retList.length; i++) {
var currents = CleanVal(retList[i]); var cleanKw = CleanVal(retList[i]);
if (!hashMapResults[currents]){ if (cleanKw.length && !hashMapResults[cleanKw]){
hashMapResults[currents] = 1; hashMapResults[cleanKw] = 1;
// add base suggestion to queue // add base suggestion to queue
if (currents!==search) if (cleanKw!==search)
keywordsToQuery[keywordsToQuery.length] = currents; keywordsToQuery[keywordsToQuery.length] = cleanKw;
// add prefix permutations // add prefix permutations
for (var k = 0; k < prefixes.length; k++) { for (var k = 0; k < prefixes.length; k++) {
var chr = prefixes[k]; var chr = prefixes[k];
var currentx = chr + ' ' + currents; var currentx = chr + ' ' + cleanKw;
keywordsToQuery[keywordsToQuery.length] = currentx; keywordsToQuery[keywordsToQuery.length] = currentx;
hashMapResults[currentx] = 1; hashMapResults[currentx] = 1;
} }
// add suffix permutations // add suffix permutations
for (var j = 0; j < prefixes.length; j++) { for (var j = 0; j < prefixes.length; j++) {
var chr = prefixes[j]; var chr = prefixes[j];
var currentx = currents + ' ' + chr; var currentx = cleanKw + ' ' + chr;
keywordsToQuery[keywordsToQuery.length] = currentx; keywordsToQuery[keywordsToQuery.length] = currentx;
hashMapResults[currentx] = 1; hashMapResults[currentx] = 1;
} }
@@ -222,26 +211,58 @@ function permuteResultsToQueue(retList, search){
} }
} }
/** Display data from db upon pressing load button **/
function loadFromDB(){
var reqObj = db.transaction(["suggestions"],"readonly").
objectStore("suggestions")
.getAll()
.onsuccess = function(e) {
if (e.target.result.length){
var retList = [];
for (var i = 0; i < e.target.result.length; i++) {
displayResults([e.target.result[i].keyword],e.target.result[i].search,false);
}
}
table.draw(false);
};
reqObj.onerror=errorHandler;
}
/** Display results **/ /** Display results **/
function displayResults(retList, search){ function displayResults(retList, search, dontDisplay){
for (var i = 0; i < retList.length; i++) { for (var i = 0; i < retList.length; i++) {
var cleanKw = CleanVal(retList[i]); var cleanKw = CleanVal(retList[i]);
// display
table.row.add([
table.rows()[0].length,
cleanKw,
cleanKw.length,
undefined,
undefined,
search]);
}
table.draw(false);
// FilterAndDisplay(); // we get an annoying popup alert if we add undefined values, catch them
// if (cleanKw===undefined||table.rows()[0].length===undefined||cleanKw.length===undefined,search===undefined){
// var textarea = document.getElementById("input"); console.error('Undefined values',{
// textarea.scrollTop = textarea.scrollHeight; id: table.rows()[0].length,
// keyword: cleanKw,
length: cleanKw? cleanKw.length: undefined,
search:search
});
continue;
} else if (cleanKw!==undefined && cleanKw.length){
// Check if suggestion is already displayed before adding
// var matches = table.data().filter(function(v){return v[1]===cleanKw && v[5]==search;}).count();
// if (!matches)
table.row.add([
table.rows()[0].length,
cleanKw,
cleanKw.length,
null,
null,
search]);
}
}
if (!dontDisplay) table.draw(false);
} }
/** Store new results in db and hashmap **/ /** Store new results in db and hashmap **/
@@ -249,22 +270,23 @@ function storeResults(retList, search, url){
for (var i = 0; i < retList.length; i++) { for (var i = 0; i < retList.length; i++) {
var cleanKw = CleanVal(retList[i]); var cleanKw = CleanVal(retList[i]);
if (cleanKw.length){
// TODO check if I should add in bulk?
// TODO check if I should add in bulk? // add to db
var transaction = db.transaction(["suggestions"], "readwrite");
// add to db transaction.onerror = errorHandler;
var transaction = db.transaction(["suggestions"], "readwrite"); var objectStore = transaction.objectStore("suggestions");
transaction.onerror = errorHandler; addReq = objectStore.add({
var objectStore = transaction.objectStore("suggestions"); keyword: cleanKw,
addReq = objectStore.add({ Length: cleanKw.length,
keyword: cleanKw, search: search,
Length: cleanKw.length, ip: myIp,
search: search, url: this.url,
ip: myIp, time: (new Date()).toUTCString()
url: this.url, });
time: (new Date()).toUTCString() addReq.onerror=errorHandler;
}); }
addReq.onerror=errorHandler;
} }
} }
@@ -304,6 +326,7 @@ function QueryKeyword(search) {
} }
displayResults(retList,search); displayResults(retList,search);
permuteResultsToQueue(retList); permuteResultsToQueue(retList);
queryLock = false;
} }
else { else {
// search not done, lets do the query // search not done, lets do the query
@@ -316,7 +339,7 @@ function QueryKeyword(search) {
client: "chrome" client: "chrome"
}, },
success: function (res, statusText, jqXHR) { success: function (res, statusText, jqXHR) {
var search = res[0]; // var search = res[0];
var retList = res[1]; var retList = res[1];
var char, currentx; var char, currentx;
@@ -334,23 +357,28 @@ function QueryKeyword(search) {
reqObj.onerror=errorHandler; reqObj.onerror=errorHandler;
} }
/** Clean input, may not all be needed **/
function CleanVal(input) { function CleanVal(input) {
var val = input; var val = input;
val = val.replace("\\u003cb\\u003e", "");
val = val.replace("\\u003c\\/b\\u003e", ""); // legacy
val = val.replace("\\u003c\\/b\\u003e", ""); // val = val.replace("<b>", "");
val = val.replace("\\u003cb\\u003e", ""); // val = val.replace("</b>", "");
val = val.replace("\\u003c\\/b\\u003e", ""); // val = val.replace("</b>", "");
val = val.replace("\\u003cb\\u003e", ""); // val = val.replace("<b>", "");
val = val.replace("\\u003cb\\u003e", ""); // val = val.replace("</b>", "");
val = val.replace("\\u003c\\/b\\u003e", ""); // val = val.replace("<b>", "");
val = val.replace("\\u0026amp;", "&"); // val = val.replace("<b>", "");
val = val.replace("\\u003cb\\u003e", ""); // val = val.replace("</b>", "");
val = val.replace("\\u0026", ""); // val = val.replace("&amp;", "&");
val = val.replace("\\u0026#39;", "'"); // val = val.replace("<b>", "");
val = val.replace("#39;", "'"); // val = val.replace("&", "");
val = val.replace("\\u003c\\/b\\u003e", ""); // val = val.replace("&#39;", "'");
val = val.replace("\\u2013", "2013"); // val = val.replace("#39;", "'");
// val = val.replace("</b>", "");
// val = val.replace("", "2013");
// this removes navigation suggestions
if (val.length > 4 && val.substring(0, 4) == "http") val = ""; if (val.length > 4 && val.substring(0, 4) == "http") val = "";
return val; return val;
} }
@@ -359,9 +387,9 @@ function CleanVal(input) {
function Filter(listToFilter) { function Filter(listToFilter) {
var retList = listToFilter; var retList = listToFilter;
if (document.getElementById("filter-positive").value.length > 0) { if ($("#filter-positive").val().length > 0) {
var filteredList = []; var filteredList = [];
var filterContains = document.getElementById("filter-positive").value.split("\n"); var filterContains = $("#filter-positive").val().split("\n");
for (var i = 0; i < retList.length; i++) { for (var i = 0; i < retList.length; i++) {
var currentKeyword = retList[i]; var currentKeyword = retList[i];
var boolContainsKeyword = false; var boolContainsKeyword = false;
@@ -382,9 +410,9 @@ function Filter(listToFilter) {
retList = filteredList; retList = filteredList;
} }
if (document.getElementById("filter-negative").value.length > 0) { if ($("#filter-negative").val().length > 0) {
var filteredList = []; var filteredList = [];
var filterContains = document.getElementById("filter-negative").value.split("\n"); var filterContains = $("#filter-negative").val().split("\n");
for (var i = 0; i < retList.length; i++) { for (var i = 0; i < retList.length; i++) {
var currentKeyword = retList[i]; var currentKeyword = retList[i];
var boolCleanKeyword = true; var boolCleanKeyword = true;
@@ -416,14 +444,20 @@ function FilterAndDisplay() {
sb += outputKeywords[i]; sb += outputKeywords[i];
sb += '\n'; sb += '\n';
} }
document.getElementById("input").value = sb; $("#input").val(sb);
document.getElementById("numofkeywords").innerHTML = '' + outputKeywords.length + ' : ' + keywordsToQuery.length; $("#numofkeywords").html('Queue:' + outputKeywords.length + ', Results: ' + table.data().length);
} }
/** read settings from webpage **/ /** read settings from webpage **/
function readSettings(){ // function readSettings(){
// rateLimit = $('#service').val();
} // filterNegative = $('#filter-negative').val();
// filterPositive = $('#filter-positive').val();
// rateLimit = $('#rate-limit').val();
// // input = $('#input').val();
// prefixes = $('#prefixes').val();
// suffixes = $('#suffixes').val();
// }
/** load settings from localStorage **/ /** load settings from localStorage **/
function loadSettings(){ function loadSettings(){
// TODO do table settings as well, e.g. column visibilitity // TODO do table settings as well, e.g. column visibilitity
@@ -454,11 +488,7 @@ function reset(){
} }
$(document).ready(function () { $(document).ready(function () {
loadSettings(); loadSettings();
table = $('#outtable').DataTable({ table = $('#outtable').DataTable({
pageLength: 25, pageLength: 25,
dom: dom:
@@ -491,7 +521,7 @@ $(document).ready(function () {
"targets": 5, "targets": 5,
"visible": false, "visible": false,
}], }],
ordering: [[ 0, 'dec' ]], ordering: [[ 0, 'asc' ]],
colReorder: {}, colReorder: {},
stateSave: true stateSave: true
}); });
+1
View File
@@ -37,6 +37,7 @@
@brand-danger: #D9230F; @brand-danger: #D9230F;
@brand-primary: #D9831F; @brand-primary: #D9831F;
@btn-primary-color: white; @btn-primary-color: white;
@btn-danger-color: white;
.btn-primary { .btn-primary {
font-weight: bold; font-weight: bold;
} }