Access some basic EPO Open Patent Services with node.js
var ops = require ('epo-ops') ({
consumer_key: 'abc123',
consumer_secret: '987xyz'
});
ops.get ('/developers/me/stats/usage', { timeRange: '01-01-2015' }, console.log);
Normal: npm install epo-ops
Development: npm install fvdm/nodejs-epo-ops#develop
Each method below takes a callback function to process the results.
This callback receives two arguments: err
and data
.
When an error occurs, err
is an instance of Error.
When everything is alright err
is null and data
is the result.
message | description | properties |
---|---|---|
request failed | The request cannot be made | |
API error | The API returned an error | error |
( path, [params], callback )
Get a resource.
parameter | type | required | default | description |
---|---|---|---|---|
path | string | yes | Resource path part after /3.1 |
|
params | object | no | Resource parameters | |
callback | function | yes | Callback function |
var params = {
timeRange: '01-01-2015'
};
ops.get ('/developers/me/stats/usage', params, console.log);
( callback )
Get a new access token.
parameter | type | required | default | description |
---|---|---|---|---|
callback | function | yes | Callback function |
ops.accessToken (function (err, res) {
if (err) {
return console.log (err);
}
console.log ('New access_token: %s', res.access_token);
});
Status is an object with quota and access information from the API. A request must already been made to populate this object.
ops.accessToken (function (err, res) {
console.log (ops.status);
});
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to http://unlicense.org/