-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprint-ids.html
47 lines (41 loc) · 1.18 KB
/
print-ids.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Print PSI IDs</title>
<style>
div pre {
font-size: 16;
font-family: Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>
<div id="print-here">
</div>
</body>
<script src="assets/js/engine/psi/psi.js"></script>
<script>
(async function () {
const psiTool = new PsiTool('https://wp-rocket.me/');
const psiResult = await psiTool.run();
const arrayResult = [...psiResult.all_failed, ...psiResult.passed];
// console.log(allResults);
const printHere = document.getElementById('print-here');
console.log(arrayResult.length);
arrayResult.forEach((audit) => {
let toPrint = `
{
id: '${audit.id}',
title: '${audit.title}',
}
`
let newPre = document.createElement('pre');
newPre.innerHTML = toPrint;
printHere.appendChild(newPre);
});
})();
</script>
</html>