Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var itemList = {};
- const proxyurl = "https://cors-anywhere.herokuapp.com/";
- const url = "https://csgoempire.gg/api/v2/p2p/inventory/cached"; // site that doesn’t send Access-Control-*
- console.log(proxyurl + url);
- fetch(proxyurl + url)
- .then(response => response.json())
- .then(contents => {
- for (elt in contents) {
- if(!(contents[elt].hasOwnProperty('custom_price'))) {
- itemList[contents[elt].market_name] = contents[elt].market_value / 100;
- }
- }
- console.log(itemList);
- })
- .catch(() => console.log("Can’t access " + url + " response. Blocked by browser?"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement