tangled
alpha
login
or
join now
isabelroses.com
/
amifamousyet
0
fork
atom
scraping atproto for the most followed accounts
0
fork
atom
overview
issues
pulls
pipelines
style: fmt
isabelroses.com
6 months ago
a6ae444f
49493519
+18
-16
3 changed files
expand all
collapse all
unified
split
.prettierignore
site
build.js
template.html
+1
.prettierignore
···
2
2
build
3
3
coverage
4
4
dist
5
5
+
pnpm-lock.yaml
+13
-13
site/build.js
···
1
1
import fs from "fs";
2
2
import path from "path";
3
3
-
import { minify } from 'minify';
3
3
+
import { minify } from "minify";
4
4
5
5
const DATA_FILE = "./dist/accounts.json";
6
6
const TEMPLATE_FILE = "./site/template.html";
···
14
14
// filter to only include specific keys, saving some speed
15
15
const allowedKeys = ["did", "handle", "pds", "followersCount"];
16
16
const jsonData = rawData
17
17
-
.map((item) => {
18
18
-
const filtered = {};
19
19
-
allowedKeys.forEach((key) => {
20
20
-
if (item.hasOwnProperty(key)) {
21
21
-
filtered[key] = item[key];
22
22
-
}
23
23
-
});
17
17
+
.map((item) => {
18
18
+
const filtered = {};
19
19
+
allowedKeys.forEach((key) => {
20
20
+
if (item.hasOwnProperty(key)) {
21
21
+
filtered[key] = item[key];
22
22
+
}
23
23
+
});
24
24
25
25
-
// nuke 0 followers accounts, this massively speeds up webload speeds
26
26
-
if (filtered.followersCount === 0) return null;
25
25
+
// nuke 0 followers accounts, this massively speeds up webload speeds
26
26
+
if (filtered.followersCount === 0) return null;
27
27
28
28
-
return filtered;
29
29
-
})
30
30
-
.filter((item) => item !== null);
28
28
+
return filtered;
29
29
+
})
30
30
+
.filter((item) => item !== null);
31
31
32
32
console.log(
33
33
`Loaded ${rawData.length} records, filtered to ${allowedKeys.length} keys per record`,
+4
-3
site/template.html
···
16
16
}
17
17
18
18
body {
19
19
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
19
19
+
font-family:
20
20
+
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
20
21
background: light-dark(#f5f5f5, #000);
21
22
padding: 20px;
22
23
}
···
237
238
cell.className = "rank-cell";
238
239
} else {
239
240
const value = item[col];
240
240
-
if (col.toLowerCase() === "handle") cell.className = "handle-cell";
241
241
+
if (col.toLowerCase() === "handle")
242
242
+
cell.className = "handle-cell";
241
243
cell.textContent = value;
242
244
}
243
245
···
250
252
251
253
updateStats();
252
254
}
253
253
-
254
255
255
256
function updateStats() {
256
257
totalCount.textContent = DATA.length;