wrapper for EPO OPS version 3.2 request
- http SYNC requesting using fibers/future
- proxy based request randomization
- automatic token expiry handler
with npm do:
npm install EPO_OPS_WRAPPER
for checking IPC=A[q=IC=A]
details
var ops = require('EPO_OPS_WRAPPER')();
console.log(ops.request('rest-services/published-data/search?q=IC=A'));
@return APP[Object]
opt | type | description |
---|---|---|
proxy_list | Array of String |
[optional] format http://ip:port OR http://usename:password@ip:port |
timeout | Number |
[optional] timeout for http request [default => 1000 * 60] |
var ops = require('EPO_OPS_WRAPPER')({
proxy_list: ['http://ip:port', 'http://usename:password@ip:port'],
timeout: 1000 * 30,
});
for consumer_key & consumer_secret based signIn, all .request()
call after this use access_token if it success
opt | type | description |
---|---|---|
consumer_key | String |
for registered user |
consumer_secret | String |
for registered user |
@return true if it success, otherwise null with console.log(error)
{
,,,
access_token: [String],
application_name: [String],
client_id: [String],
'developer.email': '[email protected]',
expires_in: '1200',
issued_at: moment().format('x'),
status: 'approved',
token_type: 'BearerToken',
,,,
}
this package automatically handle access_token expiry
var ops = require('EPO_OPS_WRAPPER')({
proxy_list: ['http://ip:port', 'http://usename:password@ip:port'],
});
console.log(ops.signIn({
consumer_key: '12345',
consumer_secret: '123',
}));
console.log(ops.request('rest-services/published-data/search?q=IC=A'));
EPO OPS service SYNC http request, @return [Object]
opt | type | description |
---|---|---|
relative_url | String |
https://ops.epo.org/3.2/[relative_url] |
method | String |
default => GET |
form | Object |
for POST data |