This commit is contained in:
2016-02-11 10:59:59 +08:00
parent 8e80e77cc8
commit 518e1ac7af
6 changed files with 870 additions and 87 deletions
+5 -2
View File
@@ -3,8 +3,9 @@
"version": "0.0.5",
"description": "The second generation of keyword shitter. Bigger, better, and more pungent than other products.",
"main": "server.js",
"repository": "https://github.com/wassname/keywordshitter2",
"scripts": {
"test": "mocha",
"test": "public/test.html",
"build-css": "lessc ./src/less/main.less > public/css/style.css",
"build": "npm run build-css",
"start": "node server.js"
@@ -12,8 +13,10 @@
"author": "blackmia,wassname",
"license": "MIT",
"devDependencies": {
"chai": "^3.5.0",
"cors": "^2.7.1",
"express": "^4.13.4",
"lessc": "latest"
"lessc": "latest",
"mocha": "^2.4.5"
}
}
+15 -7
View File
@@ -77,6 +77,8 @@ lying internet</textarea>
<option>google books</option>
<option>google news</option>
<option>google shopping</option>
<option>yandex</option>
<option>baidu</option>
</select>
</div>
<div class="form-group">
@@ -84,6 +86,7 @@ lying internet</textarea>
<!-- ISO-3366-1: Alpha-2 Codes -->
<select value="us" class="form-control" name="country" id="country" title="Country code. Two letters. Only works for google for now" >
<option value=""></option>
<option value="us">United States (us)</option>
<option value="af">Afghanistan (af)</option>
<option value="ax">Åland Islands (ax)</option>
<option value="al">Albania (al)</option>
@@ -319,7 +322,6 @@ lying internet</textarea>
<option value="ua">Ukraine (ua)</option>
<option value="ae">United Arab Emirates (ae)</option>
<option value="gb">United Kingdom (gb)</option>
<option value="us">United States (us)</option>
<option value="um">United States Minor Outlying Islands (um)</option>
<option value="uy">Uruguay (uy)</option>
<option value="uz">Uzbekistan (uz)</option>
@@ -339,16 +341,16 @@ lying internet</textarea>
<label for="lang">Lang code (google):</label>
<select class="form-control" title="Lang code. Two letters. Only works for google for now" class="form-control" id="lang" value="en" >
<option value=""></option>
<option value="en" >English (default) (en)</option>
<option value="ar" >Arabic (ar)</option>
<option value="bg" >Bulgarian (bg)</option>
<option value="ca" >Catalan (ca)</option>
<option value="hr" >Croatian (hr)</option>
<option value="zh-Hans" >Chinese (Simplified) (zh-Hans)</option>
<option value="zh-Hant" >Chinese (Traditional) (zh-Hant)</option>
<option value="zh-hans" >Chinese (Simplified) (zh-hans)</option>
<option value="zh-hant" >Chinese (Traditional) (zh-hant)</option>
<option value="cs" >Czech (cs)</option>
<option value="da" >Danish (da)</option>
<option value="nl" >Dutch (nl)</option>
<option value="en" >English (default) (en)</option>
<option value="fi" >Filipino (fi)</option>l
<option value="fi" >Finnish (fi)</option>
<option value="fr" >French (fr)</option>
@@ -382,11 +384,11 @@ lying internet</textarea>
<div class="form-group">
<label for="prefixes">Prefixes</label>
<textarea type="text" title="These values are added before words to prompt the search suggestions" class="form-control" name="prefixes" id="prefixes" >a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,y,x,y,z,how,which,why,where,who,when,are,what</textarea>
<textarea type="text" title="These values are added before words to prompt the search suggestions" class="form-control" name="prefixes" id="prefixes" > ,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,y,x,y,z,how,which,why,where,who,when,are,what</textarea>
</div>
<div class="form-group">
<label for="suffixes">Suffixes:</label>
<textarea type="text" rows="2" title="These values are added after words to prompt the search suggestions" class="form-control" id="suffixes">a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,y,x,y,z,like,for,without,with,versus,vs,to,near,except,has</textarea>
<textarea type="text" rows="2" title="These values are added after words to prompt the search suggestions" class="form-control" id="suffixes"> ,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,y,x,y,z,like,for,without,with,versus,vs,to,near,except,has</textarea>
</div>
<div class="form-group">
@@ -400,7 +402,7 @@ lying internet</textarea>
</div>
<div class="form-group">
<label for="rate-limit">Rate limit (for experts):</label>
<input type="text" title="Value between searches in milliseconds" class="form-control" id="rate-limit" value="750" name="rate-limit" title="Only change if you know what you are doing. This could get your ip banned, or place a burden on the suggest servers." disabled>
<input type="text" class="form-control" id="rate-limit" value="750" name="rate-limit" title="OValue between searches in milliseconds only change if you know what you are doing. This could get your ip banned, or place an unfair burden on the suggest servers." disabled>
</div>
</form>
@@ -465,6 +467,12 @@ lying internet</textarea>
<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! -->
<script>
$(document).ready(function () {
kws2Init();
});
</script>
</body>
</html>
+133 -78
View File
@@ -1,5 +1,5 @@
// quick way to check if we already have keyword
var hashMapResults = {};
var hashMapInputs = {};
// keeping track of queue
var numOfInitialKeywords = 0;
@@ -10,18 +10,21 @@ var keywordsToQueryIndex = 0;
var doWork = false;
var queryLock = false;
var db
var maxQueueDisplay = 1000;
var db;
var table;
var prefixes;
var suffixes;
var myIp;
/**
* Get the service url based on options set in the dom.
* @return {String} A jsonp url for search suggestions with query missing from the end.
*/
function getUrl(){
function getUrl(options){
// Ref: https://github.com/estivo/Instantfox/blob/master/firefox/c1hrome/content/defaultPluginList.js
// Ref: https://github.com/bnoordhuis/mozilla-central/tree/master/browser/locales/en-US/searchplugins
// Ref: https://developers.google.com/custom-search/json-api/v1/reference/cse/list
@@ -49,38 +52,48 @@ function getUrl(){
"amazon":
"http://completion.amazon.co.uk/search/complete?method=completion&search-alias=aps&mkt=4&callback=?&q=",
"twitter":
"https://twitter.com/i/search/typeahead.json?count=30&result_type=topics&src=SEARCH_BOX&callback=?&q="
"https://twitter.com/i/search/typeahead.json?count=30&result_type=topics&src=SEARCH_BOX&callback=?&q=",
"baidu": "http://suggestion.baidu.com/su?cb=?&wd=",
"yandex": "https://yandex.com/suggest/suggest-ya.cgi?callback=?&q=?&n=30&v=4&uil={lang}&part="
};
options={
country: $('#country').val(),
service: $('#service').val(),
lang: $('#lang').val(),
};
options = getOptions(options);
return _.template(services[options.service])(options);
}
/** Parse response per service **/
function parseServiceResponse(res){
function parseServiceResponse(res,options){
// Each take a json response tand return a keyword array
RESPONSE_TEMPLATES = {
"default": function(res){return res[1];}, // opensearch default
"google": function(res){return res[1];},
"youtube": function(res){return res[1];},
"yahoo": function(res){return _.map(res.gossip.results,'key');},
"bing": function(res){return res[1];},
"ebay": function(res){
return res.res? res.res.sug: undefined;
// opensearch default
"default": function (res) {
return res[1];
},
"yahoo": function (res) {
return _.map(res.gossip.results, 'key');
},
"ebay": function (res) {
return res.res ? res.res.sug : undefined;
},
"twitter": function (res) {
return _.concat(res.users, _.map(res.topics, 'topic'), res.hashtags, res.oneclick);
},
"baidu": function (res) {
return res.s;
},
"yandex": function(res){
return _.map(res[1], function(r){
return typeof r === 'string' ? r : r[1];
});
},
"amazon": function(res){return res[1];},
"twitter": function(res){return _.concat(res.users,_.map(res.topics,'topic'),res.hashtags,res.oneclick);}
};
var service = $('#service').val();
var parser = RESPONSE_TEMPLATES[service] || RESPONSE_TEMPLATES["default"];
options = getOptions(options);
var parser = RESPONSE_TEMPLATES[options.service] || RESPONSE_TEMPLATES["default"];
return parser(res);
}
function setUpDb(){
function setUpDb(success){
// setup a db. Ref: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB
var dbReq = window.indexedDB.open("KeywordShitter2", 3);
/** Error handler for all child transactions as events bubbe up **/
@@ -97,6 +110,7 @@ function setUpDb(){
console.error("Database error",arguments);
return this;
};
if (success) success(db,dbReq);
return db;
};
dbReq.onupgradeneeded = function (event) {
@@ -120,32 +134,39 @@ function setUpDb(){
return db;
};
return db;
return dbReq;
}
function StartJob() {
if (doWork === false) {
hashMapResults = {};
hashMapInputs = {};
keywordsToQuery = [];
keywordsToQueryIndex = 0;
hashMapResults[""] = 1;
// hashMapResults[" "] = 1;
hashMapResults[" "] = 1;
hashMapInputs[""] = 1;
// hashMapInputs[" "] = 1;
hashMapInputs[" "] = 1;
// update config
prefixes = $('#prefixes').val().split(',');
suffixes = $('#suffixes').val().split(',');
// get queries from the input
var ks = $('#input').val().split("\n");
for (var i = 0; i < ks.length; i++) {
if (ks[i].trim().length)
keywordsToQuery[keywordsToQuery.length] = ks[i];
}
numOfInitialKeywords = keywordsToQuery.length;
if (!numOfInitialKeywords) permuteResultsToQueue([' ']);
// add variations of the initial terms
// (before we start adding variations of the results)
if (!numOfInitialKeywords)
permuteResultsToQueue([' ']);
else
permuteResultsToQueue(keywordsToQuery);
FilterAndDisplay();
doWork = true;
@@ -193,51 +214,61 @@ function DoJob() {
/** Make permutations of results and add to queue **/
function permuteResultsToQueue(retList, search){
var chr, currentx, currentKw;
// sort so the shortest is first in the queue
retList.sort(function (a, b) {
return a.length - b.length;
});
// add each result to list first before permutations
for (var j = 0; j < retList.length; j++) {
cleanKw = CleanVal(retList[j]);
// add base suggestion to queue if it's not already done and isn't empty
if (cleanKw && cleanKw.trim().length && cleanKw!==search && !hashMapInputs[cleanKw])
keywordsToQuery[keywordsToQuery.length] = cleanKw;
hashMapInputs[cleanKw] = 1;
}
for (var i = 0; i < retList.length; i++) {
var cleanKw = CleanVal(retList[i]);
if (cleanKw.length && !hashMapResults[cleanKw]){
hashMapResults[cleanKw] = 1;
// add base suggestion to queue
if (cleanKw && cleanKw.trim().length && cleanKw!==search)
keywordsToQuery[keywordsToQuery.length] = cleanKw;
cleanKw = CleanVal(retList[i]);
if (cleanKw.length){
// add prefix permutations
for (var k = 0; k < prefixes.length; k++) {
var chr = prefixes[k];
var currentx = chr + ' ' + cleanKw;
keywordsToQuery[keywordsToQuery.length] = currentx;
hashMapResults[currentx] = 1;
chr = prefixes[k];
currentx = chr + ' ' + cleanKw;
if (!hashMapInputs[currentx])
keywordsToQuery[keywordsToQuery.length] = currentx;
hashMapInputs[currentx] = 1;
}
// add suffix permutations
for (var j = 0; j < prefixes.length; j++) {
var chr = prefixes[j];
var currentx = cleanKw + ' ' + chr;
keywordsToQuery[keywordsToQuery.length] = currentx;
hashMapResults[currentx] = 1;
chr = prefixes[j];
currentx = cleanKw + ' ' + chr;
if (!hashMapInputs[currentx])
keywordsToQuery[keywordsToQuery.length] = currentx;
hashMapInputs[currentx] = 1;
}
}
}
}
/** xport db as json **/
function exportDB(){
/** export db as json **/
function exportDB(success){
var reqObj = db.transaction(["suggestions"],"readonly")
.objectStore("suggestions")
.getAll();
reqObj.onsuccess = function(e) {
var blob, name;
if (e.target.result.length){
var jsonData = JSON.stringify(e.target.result);
var blob = new Blob([jsonData], {type: "octet/stream"});
saveAs(blob,'keywordshitter_'+(new Date())+'.json');
blob = new Blob([jsonData], {type: "octet/stream"});
var timeStamp = (new Date()).toISOString().replace(/[:\.]/g,'_').slice(0,-5);
name = 'keywordshitter_'+timeStamp+'_r'+e.target.result.length+'.json';
saveAs(blob,name);
if (success) success(blob);
}
return;
return blob;
};
return reqObj;
}
@@ -327,17 +358,19 @@ function extractDomain(url) {
//find & remove port number
domain = domain.split(':')[0];
// custom, add ds= param to distinguish googles diff searchs
var ds = url.match('ds=(..?)&')[1];
if (ds && ds.length) domain+='&ds='+ds;
// custom, add ds= param to distinguish googles etc diff searchs
var mr = url.match('ds=(..?)&');
if (mr && mr[1] && mr[1].length) domain+='&ds='+mr[1];
// also country
var gl = url.match('gl=(..?)&')[1];
if (gl && gl.length) domain+='&gl='+gl;
var mr = url.match('gl=(..?)&');
if (mr && mr[1] && mr[1].length) domain+='&gl='+mr[1];
// also country
var hl = url.match('hl=(..?)&')[1];
if (hl && hl.length) domain+='&hl='+gl;
var mr = url.match('hl=(..?)&');
if (mr && mr[1] && mr[1].length) domain+='&hl='+mr[1];
// lang code for yandex
var mr = url.match('uil=(..?)&');
if (mr && mr[1] && mr[1].length) domain+='&uil='+mr[1];
return domain;
}
@@ -535,25 +568,39 @@ function Filter(listToFilter) {
function FilterAndDisplay() {
var i = 0;
var sb = '';
var outputKeywords = keywordsToQuery;
for (i = 0; i < outputKeywords.length; i++) {
for (i = 0; i < Math.min(outputKeywords.length,maxQueueDisplay); i++) {
sb += outputKeywords[i];
sb += '\n';
}
if (outputKeywords.length>maxQueueDisplay) sb+='...\n';
$("#input").val(sb);
$("#numofkeywords").html('Queue:' + outputKeywords.length + ', Results: ' + table.data().length);
$("#numofkeywords").html('Queue:' + outputKeywords.length);
}
/** overrides default with dom options with arguments options **/
function getOptions(argOptions){
var defaultOptions={}; // for now defaults are set in html
if (argOptions===undefined) argOptions={};
return _.defaults(argOptions,getDomOptions(),defaultOptions);
}
/** read settings from webpage **/
// 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();
// }
function getDomOptions(){
return {
service : $('#service').val(),
filterNegative: $('#filter-negative').val(),
filterPositive: $('#filter-positive').val(),
rateLimit: $('#rate-limit').val(),
// input: $('#input').val(),
prefixes: $('#prefixes').val(),
suffixes: $('#suffixes').val(),
country: $('#country').val(),
lang: $('#lang').val(),
};
}
/** load settings from localStorage **/
function loadSettings(){
@@ -590,8 +637,9 @@ function reset(){
saveSettings();
}
setUpDb();
$(document).ready(function () {
function kws2Init(){
setUpDb();
window.setInterval(DoJob, 750);
//
// $('#startjob').on('click',StartJob);
@@ -607,10 +655,16 @@ $(document).ready(function () {
"<'row'<'col-sm-8'i><'col-sm-4'<'pull-right'f>>>" +
"<'row'<'col-sm-12'tr>>",
buttons: [
'copyHtml5',
'csvHtml5',
'colvis',
'pageLength',
{
extend: 'collection',
text: 'Export',
buttons: [
'copyHtml5',
'csvHtml5',
]
}
// {
// extend: 'csvHtml5',
// fieldBoundary: "",
@@ -661,16 +715,17 @@ $(document).ready(function () {
"visible": false,
}],
order: [[ 0, 'desc' ]],
colReorder: {},
// colReorder: {},
stateSave: true,
fixedHeader: true,
responsive: true,
// responsive: true,
// scrollY: 500,
// deferRender: true,
// scroller: true
});
});
$.getJSON('https://api.ipify.org?format=json', function (data) {
myIp = data.ip;
});
$.getJSON('https://api.ipify.org?format=json', function (data) {
myIp = data.ip;
});
}
+111
View File
@@ -0,0 +1,111 @@
var expect = chai.expect;
var assert = chai.assert;
describe('db', function() {
it('should correctly set up db', function() {
var dbReq=setUpDb();
var oldonsuccess=dbReq.onsuccess;
dbReq.onsuccess=function(event){
// override onld onsucess because it doesn't use promises
var db=oldonsuccess.bind(dbReq)(event);
assert(db);
};
});
});
describe('extractDomain', function(){
it('should correctly extract domain from url', function() {
for (var expectedDomain in testData.domainUrls) {
if (testData.domainUrls.hasOwnProperty(expectedDomain)) {
var url = testData.domainUrls[expectedDomain];
var domain = extractDomain(url);
assert.equal(expectedDomain,domain);
}
}
});
});
// describe('permute', function(){
// it('should correctly permute results and add to queue', function() {
// });
// });
// TODO use localForage or most popular promise wrapper for indexedDB then test
// describe('exportDB', function(){
// before(function() {
// // setup up test db
// });
//
// after(function() {
// // tear down test db
// });
//
// it('should correctly download json file', function() {
// exportDB();
// });
// });
describe('responses', function(){
it('should correctly parse test data', function() {
for (var service in testData.responses) {
if (testData.responses.hasOwnProperty(service)) {
var res = testData.responses[service];
var options = {service:service};
var parsedRes = parseServiceResponse(res,options);
assert.typeOf(parsedRes,'array');
expect(parsedRes).to.have.length.above(1);
parsedRes.map(r => assert.typeOf(r, 'string'));
}
}
});
});
describe('services', function() {
'use strict';
// data
var services = ["google", "google news", "google shopping", "google books", "youtube", "google videos", "google images", "yahoo", "bing", "ebay", "amazon", "twitter", "baidu", "yandex"];
var searches = ["where"];
var searches2 = [""," "," * ",":)","❥","غرف شات","汉字"];
before(function() {
});
after(function() {
});
it('should correctly get and parse data', function() {
services.forEach(function(service){
searches.forEach(function(search){
var options = {service:service};
var url = getUrl(options)+search;
$.ajax({
url: url,
async: false,
jsonp: "jsonp",
dataType: "jsonp",
success: function (res, statusText, jqXHR) {
assert(statusText=="success");
assert(res!==[]);
var parsedRes = parseServiceResponse(res,options);
assert.typeOf(parsedRes,'array');
expect(parsedRes).to.have.length.above(1);
parsedRes.map(r => assert.typeOf(r, 'string'));
},
error: function(jqXHR,textStatus,err){
throw(err);
}
});
});
});
});
});
+568
View File
@@ -0,0 +1,568 @@
function testData() {
return {
domainUrls: {
"api.bing.com": "http://api.bing.com/osjson.aspx?JsonType=callback&JsonCallback=jQuery111&query=a &_=11111",
"autosug.ebay.com": "http://autosug.ebay.com/autosug?_jgr=1&sId=0&_ch=0&callback=jQuery111&kwd=a &_=11111",
"completion.amazon.co.uk": "http://completion.amazon.co.uk/search/complete?method=completion&search-alias=aps&mkt=4&callback=jQuery111&q=a &_=11111",
"search.yahoo.com": "https://search.yahoo.com/sugg/ff?output=jsonp&appid=ffd&callback=jQuery111&command=a &_=11111",
"suggestqueries.google.com&gl=US&hl=en": "http://suggestqueries.google.com/complete/search?client=chrome&hl=en&gl=US&callback=jQuery111&q=a &_=11111",
"suggestqueries.google.com&ds=i&gl=US&hl=en": "http://suggestqueries.google.com/complete/search?client=chrome&hl=en&ds=i&gl=US&callback=jQuery111&q=a &_=11111",
"suggestqueries.google.com&ds=sh&gl=US&hl=en": "http://suggestqueries.google.com/complete/search?client=chrome&hl=en&ds=sh&gl=US&callback=jQuery111&q=a &_=11111",
"suggestqueries.google.com&ds=yt&gl=US&hl=en": "http://suggestqueries.google.com/complete/search?client=chrome&hl=en&ds=yt&gl=US&callback=jQuery111&q=a &_=11111",
"suggestqueries.google.com&gl=us&hl=en": "http://suggestqueries.google.com/complete/search?client=chrome&hl=en&gl=us&callback=jQuery111&q=oil&_=11111",
"suggestqueries.google.com&gl=us&hl=fi": "http://suggestqueries.google.com/complete/search?client=chrome&hl=fi&gl=us&callback=jQuery111&q=a &_=11111",
"suggestqueries.google.com&gl=us&hl=he": "http://suggestqueries.google.com/complete/search?client=chrome&hl=he&gl=us&callback=jQuery111&q=a &_=11111",
"suggestqueries.google.combo": "http://suggestqueries.google.com/complete/search?client=chrome&hl=en&ds=bo&gl=US&callback=jQuery111&q=a &_=11111",
"twitter.com": "https://twitter.com/i/search/typeahead.json?count=30&result_type=topics&src=SEARCH_BOX&callback=jQuery111&q=I accidentally&_=11111"
},
responses: {
"yahoo": {
"gossip": {
"qry": "where",
"gprid": "xfbzDJDaR9yN9o2B4J0JBA",
"results": [{
"key": "where's my refund",
"mrk": 6
}, {
"key": "where is super bowl 2016",
"mrk": 6
}, {
"key": "where's my refund 2016",
"mrk": 6
}, {
"key": "where the wild things are",
"mrk": 6
}, {
"key": "wheresgeorge.com",
"mrk": 5
}, {
"key": "where's waldo",
"mrk": 6
}, {
"key": "where to get a passport",
"mrk": 6
}, {
"key": "where the red fern grows",
"mrk": 6
}, {
"key": "where can i watch movies online for free",
"mrk": 6
}, {
"key": "where are they now",
"mrk": 6
}]
}
},
"google": ["where", ["where's my refund", "where am i", "http://www.irs.gov/individuals/article/0,,id=96596,00.html", "where is xur", "where is oj simpson now", "where is the next primary", "where to invade next", "where the wild things are", "where are you now", "where is dubai", "where is potomac", "where's waldo", "where is my phone", "where the heart is", "where the red fern grows", "where is the zika virus", "where was ted cruz born", "where is oak island", "where are you christmas", "where ya at"],
["", "", "Where's My Refund - It's Quick, Easy, and Secure.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
[], {
"google:clientdata": {
"bpc": false,
"tlw": false
},
"google:suggestrelevance": [1250, 602, 601, 600, 565, 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, 550],
"google:suggesttype": ["QUERY", "QUERY", "NAVIGATION", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY"],
"google:verbatimrelevance": 851
}
],
"google news": ["where", ["where is mali", "http://www.irs.gov/individuals/article/0,,id=96596,00.html", "where is isis", "where is xur", "where is john cena", "where is ronda rousey", "where is isis now", "where is san bernardino", "where is luke skywalker", "where am i", "where she went movie", "where is josh duggar now", "where is el nino", "where is reid on criminal minds", "where will isis attack next", "where is isis located", "where is frank ocean", "where the hoes at", "where is spencer on criminal minds", "where is syria"],
["", "Where's My Refund - It's Quick, Easy, and Secure.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
[], {
"google:clientdata": {
"bpc": false,
"tlw": false
},
"google:suggestrelevance": [602, 601, 600, 566, 565, 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, 550],
"google:suggesttype": ["QUERY", "NAVIGATION", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY"],
"google:verbatimrelevance": 851
}
],
"google books": ["where", ["where the red fern grows", "http://www.irs.gov/individuals/article/0,,id=96596,00.html", "where the wild things are", "where she went", "where was this book published", "where the sidewalk ends", "where rainbows end", "where am i", "where are you going where have you been", "wherever you go there you are", "where to buy", "where the red fern grows book", "where the mountain meets the moon", "where can i buy this book", "where the mind is without fear", "where is mali", "where good ideas come from", "where'd you go bernadette", "where's waldo", "whereas"],
["", "Where's My Refund - It's Quick, Easy, and Secure.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
[], {
"google:clientdata": {
"bpc": false,
"tlw": false
},
"google:suggestrelevance": [602, 601, 600, 566, 565, 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, 550],
"google:suggesttype": ["QUERY", "NAVIGATION", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY"],
"google:verbatimrelevance": 851
}
],
"youtube": ["where", ["where are you now justin bieber", "where ya at future", "http://www.irs.gov/individuals/article/0,,id=96596,00.html", "where are you christmas", "where is the love", "where are you christmas faith hill", "where do the good boys go to hideaway", "where is my mind", "where they from", "where the hood at", "where are you now justin bieber lyrics", "where ya at future lyrics", "where is the love black eyed peas lyrics", "where have you been rihanna", "where is my mind piano", "wheresmychallenge", "wherever you will go the calling", "where you at", "where they at doe", "where them girls at"],
["", "", "Where's My Refund - It's Quick, Easy, and Secure.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
[], {
"google:clientdata": {
"bpc": false,
"tlw": false
},
"google:suggestrelevance": [950, 602, 601, 600, 565, 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, 550],
"google:suggesttype": ["QUERY", "QUERY", "NAVIGATION", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY"],
"google:verbatimrelevance": 851
}
],
"bing": ["where", ["whereis", "where is", "whereis.com.au", "where is maps directions", "whereis nsw", "whereis.com", "where is santa", "whereis maps", "where is it", "where am i", "whereis.com.au directions", "where is.com.au"]],
"google videos": ["where", ["where are you now justin bieber", "where ya at future", "http://www.irs.gov/individuals/article/0,,id=96596,00.html", "where are you christmas", "where is the love", "where are you christmas faith hill", "where do the good boys go to hideaway", "where is my mind", "where they from", "where the hood at", "where are you now justin bieber lyrics", "where ya at future lyrics", "where is the love black eyed peas lyrics", "where have you been rihanna", "where is my mind piano", "wheresmychallenge", "wherever you will go the calling", "where you at", "where they at doe", "where them girls at"],
["", "", "Where's My Refund - It's Quick, Easy, and Secure.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
[], {
"google:clientdata": {
"bpc": false,
"tlw": false
},
"google:suggestrelevance": [950, 602, 601, 600, 565, 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, 550],
"google:suggesttype": ["QUERY", "QUERY", "NAVIGATION", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY"],
"google:verbatimrelevance": 851
}
],
"google shopping": ["where", ["where to buy elf on the shelf", "http://www.irs.gov/individuals/article/0,,id=96596,00.html", "where to buy cards against humanity", "where to buy essential oils", "where to buy bean boozled", "where to buy hoverboard", "where the wild things are", "where to buy citric acid", "where to buy mistletoe", "where can i buy a hoverboard", "where can you buy bean boozled", "where to buy ugly christmas sweater", "where can i buy a lokai bracelet", "where can i buy elf on the shelf", "where to buy beard oil", "where can i buy mercer's wine ice cream", "where's waldo", "where in the world is carmen sandiego", "where the red fern grows", "where to buy garcinia cambogia"],
["", "Where's My Refund - It's Quick, Easy, and Secure.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
[], {
"google:clientdata": {
"bpc": false,
"tlw": false
},
"google:suggestrelevance": [602, 601, 600, 566, 565, 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, 550],
"google:suggesttype": ["QUERY", "NAVIGATION", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY"],
"google:verbatimrelevance": 851
}
],
"ebay": {
"prefix": "where",
"dict": "0",
"res": {
"sug": ["where the wild things are", "where women create", "where the sidewalk ends", "where monsters dwell", "where eagles dare", "where the red fern grows", "where's waldo", "wheres mickey vera bradley", "wheres waldo book", "where the wild things are book"],
"categories": [
[1093, "Children & Young Adults"],
[2624, "TV, Movie & Character Toys"]
],
"isTopQuery": false
}
},
"google images": ["where", ["where's waldo", "http://www.irs.gov/individuals/article/0,,id=96596,00.html", "where the wild things are", "where is mali", "where's wally", "where to shoot a deer", "where are you", "where is your liver", "where is syria", "where the red fern grows", "where is your appendix", "where are you now", "where is isis", "where is bora bora", "where is dubai", "where is the liver", "where the sidewalk ends", "where is the liver located", "where in the world is carmen sandiego", "where's the beef"],
["", "Where's My Refund - It's Quick, Easy, and Secure.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
[], {
"google:clientdata": {
"bpc": false,
"tlw": false
},
"google:suggestrelevance": [602, 601, 600, 566, 565, 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, 550],
"google:suggesttype": ["QUERY", "NAVIGATION", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY", "QUERY"],
"google:verbatimrelevance": 851
}
],
"amazon": ["where", ["where she went", "where the wild things are", "where the trail ends", "this is where i leave you", "where is wally", "where to invade next", "where we are", "how to be parisian wherever you are", "where hope grows", "where is waldo"],
[{
"nodes": [{
"name": "Fremdsprachige Bücher",
"alias": "english-books"
}, {
"name": "Kindle-Shop",
"alias": "digital-text"
}]
}, {}, {}, {}, {}, {}, {}, {}, {}, {}],
[]
],
"twitter": {
"num_results": 30,
"users": [],
"topics": [{
"topic": "#WhereWereYou",
"rounded_score": 93013,
"tokens": [{
"token": "#wherewereyou"
}],
"inline": false
}, {
"topic": "wherever you are",
"rounded_score": 75887,
"tokens": [{
"token": "wherever"
}, {
"token": "you"
}, {
"token": "are"
}],
"inline": false
}, {
"topic": "where to invade next",
"rounded_score": 64255,
"tokens": [{
"token": "where"
}, {
"token": "to"
}, {
"token": "invade"
}, {
"token": "next"
}],
"inline": false
}, {
"topic": "#WhereToInvadeNext",
"rounded_score": 64255,
"tokens": [{
"token": "#wheretoinvadenext"
}],
"inline": false
}, {
"topic": "where are you now",
"rounded_score": 63587,
"tokens": [{
"token": "where"
}, {
"token": "are"
}, {
"token": "you"
}, {
"token": "now"
}],
"inline": false
}, {
"topic": "#WhereDealsHappen",
"rounded_score": 63587,
"tokens": [{
"token": "#wheredealshappen"
}],
"inline": false
}, {
"topic": "#WheresRey",
"rounded_score": 52917,
"tokens": [{
"token": "#wheresrey"
}],
"inline": false
}, {
"topic": "where",
"rounded_score": 51445,
"tokens": [{
"token": "where"
}],
"inline": false
}, {
"topic": "Wheres the coke baby",
"rounded_score": 43482,
"tokens": [{
"token": "wheres"
}, {
"token": "the"
}, {
"token": "coke"
}, {
"token": "baby"
}],
"inline": false
}, {
"topic": "whereslloyd",
"rounded_score": 43109,
"tokens": [{
"token": "whereslloyd"
}],
"inline": false
}, {
"topic": "where is my mind",
"rounded_score": 43074,
"tokens": [{
"token": "where"
}, {
"token": "is"
}, {
"token": "my"
}, {
"token": "mind"
}],
"inline": false
}, {
"topic": "where do you see yourself",
"rounded_score": 40908,
"tokens": [{
"token": "where"
}, {
"token": "do"
}, {
"token": "you"
}, {
"token": "see"
}, {
"token": "yourself"
}],
"inline": false
}, {
"topic": "WHERE FUTURES END",
"rounded_score": 40908,
"tokens": [{
"token": "where"
}, {
"token": "futures"
}, {
"token": "end"
}],
"inline": false
}, {
"topic": "where you at",
"rounded_score": 40908,
"tokens": [{
"token": "where"
}, {
"token": "you"
}, {
"token": "at"
}],
"inline": false
}, {
"topic": "WhereTheBlowAt",
"rounded_score": 40908,
"tokens": [{
"token": "wheretheblowat"
}],
"inline": false
}, {
"topic": "where are we gonna meet up",
"rounded_score": 35857,
"tokens": [{
"token": "where"
}, {
"token": "are"
}, {
"token": "we"
}, {
"token": "gonna"
}, {
"token": "meet"
}, {
"token": "up"
}],
"inline": false
}, {
"topic": "where are you at summer",
"rounded_score": 35857,
"tokens": [{
"token": "where"
}, {
"token": "are"
}, {
"token": "you"
}, {
"token": "at"
}, {
"token": "summer"
}],
"inline": false
}, {
"topic": "wheresanna",
"rounded_score": 35857,
"tokens": [{
"token": "wheresanna"
}],
"inline": false
}, {
"topic": "where you at donna",
"rounded_score": 35857,
"tokens": [{
"token": "where"
}, {
"token": "you"
}, {
"token": "at"
}, {
"token": "donna"
}],
"inline": false
}, {
"topic": "where is justin bieber",
"rounded_score": 35857,
"tokens": [{
"token": "where"
}, {
"token": "is"
}, {
"token": "justin"
}, {
"token": "bieber"
}],
"inline": false
}, {
"topic": "where the air is sweet",
"rounded_score": 35857,
"tokens": [{
"token": "where"
}, {
"token": "the"
}, {
"token": "air"
}, {
"token": "is"
}, {
"token": "sweet"
}],
"inline": false
}, {
"topic": "where is luke",
"rounded_score": 35857,
"tokens": [{
"token": "where"
}, {
"token": "is"
}, {
"token": "luke"
}],
"inline": false
}, {
"topic": "where is harry styles",
"rounded_score": 35857,
"tokens": [{
"token": "where"
}, {
"token": "is"
}, {
"token": "harry"
}, {
"token": "styles"
}],
"inline": false
}, {
"topic": "where to buy beats",
"rounded_score": 35857,
"tokens": [{
"token": "where"
}, {
"token": "to"
}, {
"token": "buy"
}, {
"token": "beats"
}],
"inline": false
}, {
"topic": "where are they",
"rounded_score": 35857,
"tokens": [{
"token": "where"
}, {
"token": "are"
}, {
"token": "they"
}],
"inline": false
}, {
"topic": "where jc",
"rounded_score": 32980,
"tokens": [{
"token": "where"
}, {
"token": "jc"
}],
"inline": false
}, {
"topic": "where's dylan o'brien",
"rounded_score": 32980,
"tokens": [{
"token": "where"
}, {
"token": "s"
}, {
"token": "dylan"
}, {
"token": "o"
}, {
"token": "brien"
}],
"inline": false
}, {
"topic": "where is drenthe",
"rounded_score": 32980,
"tokens": [{
"token": "where"
}, {
"token": "is"
}, {
"token": "drenthe"
}],
"inline": false
}, {
"topic": "where is anita",
"rounded_score": 32980,
"tokens": [{
"token": "where"
}, {
"token": "is"
}, {
"token": "anita"
}],
"inline": false
}, {
"topic": "wheres my quarter",
"rounded_score": 32980,
"tokens": [{
"token": "wheres"
}, {
"token": "my"
}, {
"token": "quarter"
}],
"inline": false
}],
"oneclick": [],
"hashtags": [],
"completed_in": 0.005,
"query": "where"
},
"baidu": {
"q": "where",
"p": false,
"s": ["whereas", "where are you now", "where is the love", "where are you", "whereby", "where did you go", "wherever you are", "where did you sleep last night", "wherever", "where there is a will there is a way"]
},
"yandex": ["where", ["where's my refund", "where is chuck norris", "where the wild things are", "where", "where's my refund 2013", "where is my tax refund", "wheresmyrefund irs refund status", "where's my state refund", "where is my state refund", "where's my water", ["", "where is my mind", {
"sg_weight": 3.69087e-9,
"search_cgi": [
["noreask", "1"]
]
}],
["", "where the wild roses grow", {
"sg_weight": 1.58832e-9,
"search_cgi": [
["noreask", "1"]
]
}],
["", "wherever you go", {
"sg_weight": 1.35346e-9,
"search_cgi": [
["noreask", "1"]
]
}],
["", "where have you been", {
"sg_weight": 1.30423e-9,
"search_cgi": [
["noreask", "1"]
]
}],
["", "where them girls at", {
"sg_weight": 1.10014e-9,
"search_cgi": [
["noreask", "1"]
]
}],
["", "where are you", {
"sg_weight": 9.90519e-10,
"search_cgi": [
["noreask", "1"]
]
}],
["", "where did you sleep last night", {
"sg_weight": 8.15709e-10,
"search_cgi": [
["noreask", "1"]
]
}],
["", "where is the love", {
"sg_weight": 7.31462e-10,
"search_cgi": [
["noreask", "1"]
]
}]
], {
"r": 211,
"log": "sgtype:BBBBBBBBBBArtArtArtArtArtArtArtArt",
"continue": "'s"
}]
}
};
}
+38
View File
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Mocha Tests</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/2.4.5/mocha.min.css" />
<style>
#fixture {
position: absolute;
top: -9999;
left: -9999;
};
</style>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/chai/3.5.0/chai.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mocha/2.4.5/mocha.js"></script>
<script> mocha.setup('bdd');</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/datatables/1.10.10/js/jquery.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script src="//cdn.datatables.net/s/bs/jszip-2.5.0,dt-1.10.10,b-1.1.0,b-colvis-1.1.0,b-html5-1.1.0,b-print-1.1.0,cr-1.3.0,fh-3.1.0,kt-2.1.0,r-2.0.0,se-1.1.0/datatables.min.js" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/4.2.0/lodash.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2014-11-29/FileSaver.min.js"></script>
<script src="js/main.js"></script>
<script src="js/testData.js"></script>
<script src="js/test.js"></script>
<script>
window.onload = function() {
mocha.run()
};
</script>
</head>
<body>
<div id="mocha"></div>
</body>
</html>