Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #11 from kbsymanz/master

Fixed examples/web-index.js
  • Loading branch information...
commit f29ff0ff81828b79139552fe7bfe67196d30ae72 2 parents 92cb2c6 + 5d97b4c
TJ Holowaychuk authored

Showing 1 changed file with 6 additions and 5 deletions. Show diff stats Hide diff stats

  1. +6 5 examples/web-index.js
11 examples/web-index.js
@@ -26,15 +26,16 @@ urls.forEach(function(url, i){
26 26 }
27 27
28 28 log('fetching');
29   - agent.get(url, function(err, res, body){
30   - if (err) throw err;
  29 + agent.get(url, function(res){
  30 + var words;
  31 +
31 32 // strip html tags
32 33 log('stripping tags');
33   - body = striptags(body);
  34 + words = striptags(res.text);
34 35
35 36 // index
36 37 log('indexing');
37   - search.index(body, i, function(err){
  38 + search.index(words, i, function(err){
38 39 if (err) throw err;
39 40 log('completed');
40 41 --pending || done();
@@ -55,4 +56,4 @@ function done() {
55 56
56 57 function striptags(html) {
57 58 return String(html).replace(/<\/?([^>]+)>/g, '');
58   -}
  59 +}

0 comments on commit f29ff0f

Please sign in to comment.
Something went wrong with that request. Please try again.