curlrequest
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -21,4 +21,5 @@ var child = require('child_process') | ||
var user_agents = fs.readFileSync('useragents.txt').toString().split('\n').slice(0, -1) | ||
, user_agent_len = user_agents.length; | ||
var ua_file = __dirname + '/useragents.txt' | ||
, user_agents = fs.readFileSync(ua_file).toString().split('\n').slice(0, -1) | ||
, user_agents_len = user_agents.length; | ||
@@ -66,3 +67,3 @@ /** | ||
return (function curl() { | ||
module.exports(options, function (err) { | ||
exports.request(options, function (err) { | ||
if (!err || !--remaining) { | ||
@@ -190,3 +191,3 @@ return callback.apply(this, arguments); | ||
if (!headers['User-Agent'] && !options['user-agent']) { | ||
options['user-agent'] = user_agents[Math.random() * user_agent_len | 0]; | ||
options['user-agent'] = user_agents[Math.random() * user_agents_len | 0]; | ||
} | ||
@@ -193,0 +194,0 @@ |
{ "name" : "curlrequest", | ||
"description" : "A curl wrapper for node", | ||
"version" : "0.2.4", | ||
"version" : "0.2.5", | ||
"homepage" : "https://github.com/chriso/curlrequest", | ||
@@ -5,0 +5,0 @@ "author" : "Chris O'Hara <cohara87@gmail.com>", |
@@ -88,3 +88,3 @@ **curlrequest** is a node wrapper for the command line **curl(1)** | ||
#### Passing options directly to curl | ||
### Passing options directly to curl | ||
@@ -111,9 +111,9 @@ Any additional options are sent as command line options to curl. See `man | ||
url: 'example.com/some/large/file.zip' | ||
, 'limit-rate': '500k' //500kb/s | ||
, encoding: null //return a buffer | ||
, 'limit-rate': '500k' | ||
, encoding: null | ||
} | ||
curl.request(options, function (err, file) { | ||
//... | ||
//file is a Buffer | ||
}) | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15474
282