keyword-miner
Advanced tools
Comparing version 0.3.5 to 0.4.0
@@ -38,2 +38,4 @@ (function() { | ||
options.limit = options.limit || 0; | ||
options.element = options.element || 'body'; | ||
options.exclude = options.exclude || []; | ||
@@ -56,3 +58,3 @@ var protocol = | ||
dom = cheerio.load(body); | ||
corpus.addDoc(dom('body').text()); | ||
corpus.addDoc(dom(options.element).text()); | ||
corpus | ||
@@ -73,2 +75,3 @@ .trim() | ||
.filter(validate) | ||
.filter(term => options.exclude.indexOf(term.word) === -1) | ||
.filter(limit(options.limit)) | ||
@@ -75,0 +78,0 @@ ); |
{ | ||
"name": "keyword-miner", | ||
"version": "0.3.5", | ||
"version": "0.4.0", | ||
"description": "Extract a list of keywords from a website, sorted by word count.", | ||
@@ -5,0 +5,0 @@ "main": "miner.js", |
@@ -51,3 +51,9 @@ # keyword-miner | ||
// limit output count, default 0 (no limit) | ||
limit: 20 | ||
limit: 20, | ||
// css element(s) to get keywords from, default 'body' | ||
element: 'body', | ||
// exclude keywords, default [] | ||
exclude: [] | ||
}; | ||
@@ -54,0 +60,0 @@ |
@@ -9,3 +9,5 @@ (function () { | ||
threshold: 5, | ||
limit: 20 | ||
limit: 20, | ||
element: 'body', | ||
exclude: [] | ||
}; | ||
@@ -12,0 +14,0 @@ |
5795
92
71