title: Pull a specific string from an HTTP request in node.js
body: <p>NOOb here. I've got a HTTP request that pulls all of the content from a specific webpage. However, all I need is a specific string:<code>"Most recent instantaneous value: "</code>. In fact,  I actually need to store the value that follows <code>value:</code>. Here is my code:</p>
  
  <pre><code>var http = require("http");
  
  var options = {
   host: 'waterdata.usgs.gov',
   port: 80,
   path: '/ga/nwis/uv?cb_72036=on&amp;cb_00062=on&amp;format=gif_default&amp;period=1&amp;site_no=02334400',
   method: 'POST'
  };
  
  var req = http.request(options, function(res) {
   console.log('STATUS: ' + res.statusCode);
   console.log('HEADERS: ' + JSON.stringify(res.headers));
   res.setEncoding('utf8');
   res.on('data', function (chunk) {
   console.log('BODY: ' + chunk);
   });
  });
  
  req.on('error', function(e) {
   console.log('problem with request: ' + e.message);
  });
  
  // write data to request body
  req.write('data\n');
  req.write('data\n');
  req.end();
  </code></pre>
  
  <p>I realize I don't need all the <code>console.log</code> statements, but do I need keep <code>console.log('BODY: ' + chunk);</code> so all of the data downloads?</p>