Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if (request.priceSource == 'getItemsInstant') {
- var url = "https://csgoempire.com/api/v2/p2p/inventory/instant";
- fetch(url)
- .then(res => res.json())
- .then(items => {
- var itemsList = [];
- var addExtra = 0;
- var bundle = 0;
- user_sort(items, request.sortingMethod, request.sortingType);
- for (i = ((request.page - 1) * 50); i < addExtra + ((request.page - 1) * 50) + 50; i++) {
- if (bundle == items[i].bundle_id) {
- addExtra += 1;
- }
- itemsList.push(items[i].market_name);
- bundle = items[i].bundle_id;
- }
- sendResponse(itemsList);
- })
- .catch(err => { throw err });
- return true; // Will respond asynchronously.
- }
Add Comment
Please, Sign In to add comment