lib/common/sitemap.js
function getUrl (options, parseFn, callback) {
  request({
    url: options.source,
    encoding: null,
    timeout: options.timeout() // get the default timeout
  }, function (err, res, body) {
    var error = err || common.checkResponse(res, ["text/xml", "application/xml"]);

    if (error) {
      callback(common.prependMsgToErr(error, options.source, true));
    } else {
      convert(options, body, parseFn, callback);
    }
  });
}
function getUrl (options, parseFn, callback) {
  request({
    url: options.source,
    encoding: null,
    timeout: options.timeout() // get the default timeout
  }, function (err, res, body) {
    var error = err || common.checkResponse(res, ["text/xml", "application/xml"]);

    if (error) {
      callback(common.prependMsgToErr(error, options.source, true));
    } else {
      convert(options, body, parseFn, callback);
    }
  });
}
Retrieve the sitemap from a url and call to parse it.

@param {Object} options - Sitemap options.
@param {String} options.source - Sitemap URL.
@param {Function} options.timeout - User supplied run timeout.
@param {Function} parseFn - A data parser function.
@param {Function} callback - A completion callback function.