return bites size
This commit is contained in:
parent
d0065503c4
commit
de9ed51968
8
code.js
8
code.js
@ -44,7 +44,11 @@ function getData(value) {
|
|||||||
* @param {Array} badgesArray - массив данных о значках
|
* @param {Array} badgesArray - массив данных о значках
|
||||||
*/
|
*/
|
||||||
function exportJson(badgesArray) {
|
function exportJson(badgesArray) {
|
||||||
console.log(JSON.stringify(badgesArray));
|
const byteSize = str => new Blob([str]).size;
|
||||||
|
|
||||||
|
json = JSON.stringify(badgesArray);
|
||||||
|
console.log(json);
|
||||||
|
console.log(`Size: ${byteSize(json)} bytes.`)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -63,8 +67,6 @@ function getBadges() {
|
|||||||
})(document.getElementsByClassName('pagelink'));
|
})(document.getElementsByClassName('pagelink'));
|
||||||
|
|
||||||
while (currentPage <= totalPages) {
|
while (currentPage <= totalPages) {
|
||||||
console.log(`Parse ${currentPage} page...`);
|
|
||||||
|
|
||||||
fetch(`${baseURI}?p=${currentPage}`)
|
fetch(`${baseURI}?p=${currentPage}`)
|
||||||
.then((response) => { return response.text(); })
|
.then((response) => { return response.text(); })
|
||||||
.then((html) => {
|
.then((html) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user