Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async function task(url) {
- var r1 = await fetch(url).then(resp => resp.text());
- var r2 = await fetch(url + "/" + r1).then(resp => resp.json());
- //r2 is an array of urls
- var total = 0;
- for (var u of r2) {
- tmp = await fetch(u).then(resp => resp.text());
- total += parseInt(tmp)
- }
- return total
- }
Add Comment
Please, Sign In to add comment