scraping atproto for the most followed accounts

style: fmt

+18 -16
+1
.prettierignore
··· 2 2 build 3 3 coverage 4 4 dist 5 + pnpm-lock.yaml
+13 -13
site/build.js
··· 1 1 import fs from "fs"; 2 2 import path from "path"; 3 - import { minify } from 'minify'; 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 - .map((item) => { 18 - const filtered = {}; 19 - allowedKeys.forEach((key) => { 20 - if (item.hasOwnProperty(key)) { 21 - filtered[key] = item[key]; 22 - } 23 - }); 17 + .map((item) => { 18 + const filtered = {}; 19 + allowedKeys.forEach((key) => { 20 + if (item.hasOwnProperty(key)) { 21 + filtered[key] = item[key]; 22 + } 23 + }); 24 24 25 - // nuke 0 followers accounts, this massively speeds up webload speeds 26 - if (filtered.followersCount === 0) return null; 25 + // nuke 0 followers accounts, this massively speeds up webload speeds 26 + if (filtered.followersCount === 0) return null; 27 27 28 - return filtered; 29 - }) 30 - .filter((item) => item !== null); 28 + return filtered; 29 + }) 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 - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 19 + font-family: 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 - if (col.toLowerCase() === "handle") cell.className = "handle-cell"; 241 + if (col.toLowerCase() === "handle") 242 + cell.className = "handle-cell"; 241 243 cell.textContent = value; 242 244 } 243 245 ··· 250 252 251 253 updateStats(); 252 254 } 253 - 254 255 255 256 function updateStats() { 256 257 totalCount.textContent = DATA.length;