Skip to content
This repository has been archived by the owner on Nov 28, 2017. It is now read-only.

Commit

Permalink
REMOVE disabled pagination method. Apps using this library should imp…
Browse files Browse the repository at this point in the history
…lement their own pagination.

(Logic is too endpoint- and application-specific to make sense as a generic method here.)
  • Loading branch information
benbuckman committed Dec 9, 2015
1 parent d21cb5e commit dfd7285
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 150 deletions.
23 changes: 1 addition & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,6 @@ _for authentication, include:_
`callback` gets `(error, data)`.


### `paginateGetRequest(options, callback)`

Make a multi-page request to a GET service, running them in parallel and combining the results.

_Note: this is currently broken in 1.x. Fixes/refactors are welcome._

`options` contains the same parameters as `ebayApiGetRequest`, plus:

- pages: # of pages to query
- perPage: items per page

`parser` here needs to return an array, so the results can be concatenated and passed to `callback`.

Note: Because the pages all run in parallel, they can cause spikes on CPU and network activity. In the future, I might switch this to using an [async](https://github.com/caolan/async) `queue` (instead of `forEach`) with a variable concurrency. (A `forEachSeries` can also be used, but negates the purpose of running the requests asynchronously.)

`callback` gets `(error, items)`


## Helpers

### `flatten(obj)`
Expand Down Expand Up @@ -159,9 +141,6 @@ and http://developer.ebay.com/devzone/xml/docs/Reference/ebay/Errors/ErrorMessag
## Examples

See the [examples][examples] directory.
There are two examples, one with a single-page `findItemsByKeywords` request,
the other a paginated `findItemsAdvanced` request. It should be reasonably apparent from the examples
how these functions are used.
To run the examples, you need to add your own app key (I don't want my keys to be disabled for abuse!) -
you can get one [here](https://publisher.ebaypartnernetwork.com/PublisherToolsAPI).

Expand All @@ -177,4 +156,4 @@ Enjoy!

[network]: https://github.com/benbuckman/nodejs-ebay-api/network
[examples]: https://github.com/benbuckman/nodejs-ebay-api/tree/master/examples
[request]: https://github.com/request/request
[request]: https://github.com/request/request
50 changes: 0 additions & 50 deletions examples/paginated.js

This file was deleted.

1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var _ = require('lodash');

module.exports = _.extend({},
require('./lib/xml-request'),
require('./lib/pagination'),
require('./lib/xml-converter'),
require('./lib/json-parser'),
require('./lib/errors')
Expand Down
77 changes: 0 additions & 77 deletions lib/pagination.js

This file was deleted.

0 comments on commit dfd7285

Please sign in to comment.