|
14 | 14 |
|
15 | 15 | async function more() { |
16 | 16 | button.disabled = true |
17 | | - const todo = sitemap.slice(start,start+=50) |
| 17 | + const todo = sitemap.slice(start,start+=100) |
18 | 18 | await scan(todo) |
19 | | - button.innerText = `more of ${sitemap.length-start}` |
| 19 | + button.innerText = `more of ${Math.max(sitemap.length-start,0)}` |
20 | 20 | button.disabled = false |
21 | 21 | } |
22 | 22 |
|
|
30 | 30 | ) |
31 | 31 | } |
32 | 32 |
|
33 | | -// jq '.journal|group_by(.id)|.[]|select(any(.type=="remove") and any(.item.type=="assets")) |
| 33 | + // jq '.journal|group_by(.id)|.[]|select(any(.type=="remove") and any(.item.type=="assets")) |
34 | 34 |
|
35 | | - function check(infox,page) { |
36 | | - const groups = Object.groupBy(page.journal, info => info.id) |
37 | | - const want = Object.entries(groups).filter(([id,actions]) => |
| 35 | + function check(info,page) { |
| 36 | + const groups = Object.groupBy(page.journal, action => action.id) |
| 37 | + const wanted = Object.entries(groups).filter(([id,actions]) => |
38 | 38 | actions.some(action => action.type == "remove") && |
39 | 39 | actions.some(action => action.item?.type == "assets")) |
40 | | - if(want.length>0) { |
41 | | - result.innerHTML += `${infox.title} has\n` |
42 | | - for (const wanted of want) { |
43 | | - console.log(infox.title, wanted[0], wanted[1]) |
44 | | - result.innerHTML += ` ${wanted[0]} ${wanted[1].map(action => action.type).join(" ")}\n` |
45 | | - } |
| 40 | + if(wanted.length>0) { |
| 41 | + result.innerHTML += `${info.title}\n` |
| 42 | + wanted.forEach(([id,actions]) => { |
| 43 | + result.innerHTML += ` ${id} ${actions |
| 44 | + .map(action => `<span title="${JSON.stringify(action,null,2).replaceAll(/"/g,"'")}">${action.type}</span>`) |
| 45 | + .join(" ")}\n` |
| 46 | + }) |
46 | 47 | } |
47 | 48 | } |
48 | 49 |
|
|
0 commit comments