<commit_before>'use strict';
var log = require('npmlog');
var request = require('request');


/**
 * Scrapes a download URL from curse.com
 * @param  {String}   slug    The addon slug
 * @param  {String}   version Optional, addon version
 * @param  {Function} cb      Callback
 */
exports.getDownloadURL = function(slug, version, cb) {
  if (!cb) {
    //version is optional
    cb = version;
    version = null;
  }
  var url = 'http://www.curse.com/addons/wow/' + slug + '/' + (version || 'download');
  log.http('GET', url);
  request.get(url, function(err, res, body) {
    if (err) return cb(err);
    var durl = /data-href="(http:\/\/addons\.curse\.cursecdn\.com\/files\/[^\n"]*)"/.exec(body)[1];
    var version = parseInt(/data-file="([0-9]+)"/.exec(body)[1]);
    log.http(res.statusCode, url + ' (%d)', version);
    cb(null, durl, version);
  });<commit_msg>Removed unnecessarily optional variable for Curse scraping.<commit_after>'use strict';
var log = require('npmlog');
var request = require('request');


/**
 * Scrapes a download URL from curse.com
 * @param  {String}   slug    The addon slug
 * @param  {String}   version Addon version, can be null.
 * @param  {Function} cb      Callback
 */
exports.getDownloadURL = function(slug, version, cb) {
  var url = 'http://www.curse.com/addons/wow/' + slug + '/' + (version || 'download');
  log.http('GET', url);
  request.get(url, function(err, res, body) {
    if (err) return cb(err);
    var durl = /data-href="(http:\/\/addons\.curse\.cursecdn\.com\/files\/[^\n"]*)"/.exec(body)[1];
    var version = parseInt(/data-file="([0-9]+)"/.exec(body)[1]);
    log.http(res.statusCode, url + ' (%d)', version);
    cb(null, durl, version);
  });
{'fraction_non_alphanumeric': 0.2032806092560047, 'fraction_numerical': 0.0046865846514352666, 'mean_word_length': 3.3794871794871795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '447416', 'n_tokens_mistral': 609, 'n_tokens_neox': 593, 'n_words': 143}