Permalink
Browse files

Merge pull request #11 from kbsymanz/master

Fixed examples/web-index.js
  • Loading branch information...
2 parents 92cb2c6 + 5d97b4c commit f29ff0ff81828b79139552fe7bfe67196d30ae72 @tj committed Aug 23, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 examples/web-index.js
View
@@ -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, '');
-}
+}

0 comments on commit f29ff0f

Please sign in to comment.