Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #11 from kbsymanz/master

Fixed examples/web-index.js
  • Loading branch information...
commit f29ff0ff81828b79139552fe7bfe67196d30ae72 2 parents 92cb2c6 + 5d97b4c
@tj authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 examples/web-index.js
View
11 examples/web-index.js
@@ -26,15 +26,16 @@ urls.forEach(function(url, i){
}
log('fetching');
- agent.get(url, function(err, res, body){
- if (err) throw err;
+ agent.get(url, function(res){
+ var words;
+
// strip html tags
log('stripping tags');
- body = striptags(body);
+ words = striptags(res.text);
// index
log('indexing');
- search.index(body, i, function(err){
+ search.index(words, i, function(err){
if (err) throw err;
log('completed');
--pending || done();
@@ -55,4 +56,4 @@ function done() {
function striptags(html) {
return String(html).replace(/<\/?([^>]+)>/g, '');
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.