Giter Site home page Giter Site logo

calculateshopee's People

Contributors

aimananizan56 avatar azizimusa avatar epool86 avatar muaz234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

calculateshopee's Issues

Access Blocked By CORS Policy

There's an error when i tried to run this code, the message was like this:

Access to fetch at 'https://shopee.com.my/api/v4/order/get_order_list?limit=5&list_type=3&offset=0' from origin 'https://shopee.co.id' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
7008.6b2a9aafa20b6b03.js:1

   GET https://shopee.com.my/api/v4/order/get_order_list?limit=5&list_type=3&offset=0 net::ERR_FAILED 200 (OK)

(anonymous) @ 7008.6b2a9aafa20b6b03.js:1
f @ 7008.6b2a9aafa20b6b03.js:1
o.value @ 7008.6b2a9aafa20b6b03.js:1
(anonymous) @ 7008.6b2a9aafa20b6b03.js:1
asyncGeneratorStep @ 7008.6b2a9aafa20b6b03.js:1
a @ 7008.6b2a9aafa20b6b03.js:1
(anonymous) @ 7008.6b2a9aafa20b6b03.js:1
(anonymous) @ 7008.6b2a9aafa20b6b03.js:1
(anonymous) @ bundle.4c11e60a44e085c4.js:1
window.fetch @ 7008.6b2a9aafa20b6b03.js:1
(anonymous) @ sap-hook-latest.1b34c2a293a7bd0f.js:1
(anonymous) @ sap-hook-latest.1b34c2a293a7bd0f.js:1
calculate @ VM2179:9
(anonymous) @ VM2224:1
shopee.co.id/:1 Access to fetch at 'https://shopee.com.my/api/v4/order/get_order_list?limit=5&list_type=3&offset=0' from origin 'https://shopee.co.id' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
7008.6b2a9aafa20b6b03.js:1

   GET https://shopee.com.my/api/v4/order/get_order_list?limit=5&list_type=3&offset=0 net::ERR_FAILED 200 (OK)

(anonymous) @ 7008.6b2a9aafa20b6b03.js:1
f @ 7008.6b2a9aafa20b6b03.js:1
o.value @ 7008.6b2a9aafa20b6b03.js:1
(anonymous) @ 7008.6b2a9aafa20b6b03.js:1
asyncGeneratorStep @ 7008.6b2a9aafa20b6b03.js:1
s @ 7008.6b2a9aafa20b6b03.js:1
Promise.then (async)
asyncGeneratorStep @ 7008.6b2a9aafa20b6b03.js:1
a @ 7008.6b2a9aafa20b6b03.js:1
(anonymous) @ 7008.6b2a9aafa20b6b03.js:1
(anonymous) @ 7008.6b2a9aafa20b6b03.js:1
(anonymous) @ bundle.4c11e60a44e085c4.js:1
window.fetch @ 7008.6b2a9aafa20b6b03.js:1
(anonymous) @ sap-hook-latest.1b34c2a293a7bd0f.js:1
(anonymous) @ sap-hook-latest.1b34c2a293a7bd0f.js:1
calculate @ VM2179:9
(anonymous) @ VM2224:1
7008.6b2a9aafa20b6b03.js:1
Uncaught (in promise) TypeError: Failed to fetch
at 7008.6b2a9aafa20b6b03.js:1:881040
at f (7008.6b2a9aafa20b6b03.js:1:821312)
at o.value (7008.6b2a9aafa20b6b03.js:1:821079)
at Generator.throw (7008.6b2a9aafa20b6b03.js:1:821759)
at asyncGeneratorStep (7008.6b2a9aafa20b6b03.js:1:826827)
at s (7008.6b2a9aafa20b6b03.js:1:827099)

image

POST https://c-api-bit.shopeemobile.com/v4/tr/my net::ERR_BLOCKED_BY_CLIENT

POST https://c-api-bit.shopeemobile.com/v4/tr/my net::ERR_BLOCKED_BY_CLIENT
N
issue
@ [email protected]:1
(anonymous) @ [email protected]:1
e @ [email protected]:1
(anonymous) @ [email protected]:1
Promise.then (async)
(anonymous) @ [email protected]:1
Promise.catch (async)
e @ [email protected]:1
(anonymous) @ [email protected]:1
Promise.then (async)
(anonymous) @ [email protected]:1
Promise.catch (async)
e @ [email protected]:1
(anonymous) @ [email protected]:1
Promise.then (async)
(anonymous) @ [email protected]:1
Promise.catch (async)
e @ [email protected]:1
(anonymous) @ [email protected]:1
Promise.then (async)
(anonymous) @ [email protected]:1
Promise.catch (async)
e @ [email protected]:1
(anonymous) @ [email protected]:1

Include Date

Hi, would like to understand if there a way to add dates? I'm trying to organize the spending based on years and months and dates will be so helpful.

Other available attributes

Salam bang,
kalau macam attribute2 quantity, product category, order date ada ke bang?
Apa lagi attribute yg available utk di explore?

Tq for the fruitful code sharing :D

var total = 0; var order = 0; function calculate(next){ var opts = { method: 'GET', headers: {} }; fetch('https://shopee.com.my/api/v4/order/get_order_list?limit=5&list_type=3&offset='+next, opts).then(function (response) { return response.json(); }) .then(function (body) { var next_offset = body.data.next_offset; if(next_offset >= 0){ for (let [key, value] of Object.entries(body.data.details_list)) { var total_temp = value.info_card.final_total / 100000; total += total_temp; order++; console.log(order + ":", "RM " + total_temp + " - ", value.info_card.order_list_cards[0].items[0].name); } calculate(next_offset); } else { console.log('Calculation completed!'); console.log('GRAND TOTAL: RM ' + Math.round(total * 100) / 100); } }); } calculate(0);

var total = 0;
var order = 0;
function calculate(next){
var opts = {
method: 'GET',
headers: {}
};
fetch('https://shopee.com.my/api/v4/order/get_order_list?limit=5&list_type=3&offset='+next, opts).then(function (response) {
return response.json();
})
.then(function (body) {
var next_offset = body.data.next_offset;
if(next_offset >= 0){
for (let [key, value] of Object.entries(body.data.details_list)) {
var total_temp = value.info_card.final_total / 100000;
total += total_temp;
order++;
console.log(order + ":", "RM " + total_temp + " - ", value.info_card.order_list_cards[0].items[0].name);
}
calculate(next_offset);
} else {
console.log('Calculation completed!');
console.log('GRAND TOTAL: RM ' + Math.round(total * 100) / 100);
}
});
}
calculate(0);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.