EPO OPS WRAPPER with 1) SYNC requesting, 2) token expiry handler & 3) proxy based request randomization
npm install EPO_OPS_WRAPPER```
npm install EPO_OPS_WRAPPER
IPC=A[q=IC%3DA]` details`js
var ops = require('EPO_OPS_WRAPPER')();
console.log(ops.request('rest-services/published-data/search?q=IC%3DA'));
`$3
@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] |
`js
var ops = require('EPO_OPS_WRAPPER')({
proxy_list: ['http://ip:port', 'http://usename:password@ip:port'],
timeout: 1000 * 30,
});
`$3
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)
`js
{
,,,
access_token: [String],
application_name: [String],
client_id: [String],
'developer.email': 'linto.cet@gmail.com',
expires_in: '1200',
issued_at: moment().format('x'),
status: 'approved',
token_type: 'BearerToken',
,,,
}
`this package automatically handle access_token expiry
`js
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%3DA'));
``| opt | type | description |
| --- | --- | --- |
| relative_url | String | https://ops.epo.org/3.2/[relative_url] |
| method | String | default => GET |
| form | Object | for POST data |