scraping atproto for the most followed accounts

style: fmt

+18 -16
+1
.prettierignore
··· 2 build 3 coverage 4 dist
··· 2 build 3 coverage 4 dist 5 + pnpm-lock.yaml
+13 -13
site/build.js
··· 1 import fs from "fs"; 2 import path from "path"; 3 - import { minify } from 'minify'; 4 5 const DATA_FILE = "./dist/accounts.json"; 6 const TEMPLATE_FILE = "./site/template.html"; ··· 14 // filter to only include specific keys, saving some speed 15 const allowedKeys = ["did", "handle", "pds", "followersCount"]; 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 - }); 24 25 - // nuke 0 followers accounts, this massively speeds up webload speeds 26 - if (filtered.followersCount === 0) return null; 27 28 - return filtered; 29 - }) 30 - .filter((item) => item !== null); 31 32 console.log( 33 `Loaded ${rawData.length} records, filtered to ${allowedKeys.length} keys per record`,
··· 1 import fs from "fs"; 2 import path from "path"; 3 + import { minify } from "minify"; 4 5 const DATA_FILE = "./dist/accounts.json"; 6 const TEMPLATE_FILE = "./site/template.html"; ··· 14 // filter to only include specific keys, saving some speed 15 const allowedKeys = ["did", "handle", "pds", "followersCount"]; 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 + }); 24 25 + // nuke 0 followers accounts, this massively speeds up webload speeds 26 + if (filtered.followersCount === 0) return null; 27 28 + return filtered; 29 + }) 30 + .filter((item) => item !== null); 31 32 console.log( 33 `Loaded ${rawData.length} records, filtered to ${allowedKeys.length} keys per record`,
+4 -3
site/template.html
··· 16 } 17 18 body { 19 - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 20 background: light-dark(#f5f5f5, #000); 21 padding: 20px; 22 } ··· 237 cell.className = "rank-cell"; 238 } else { 239 const value = item[col]; 240 - if (col.toLowerCase() === "handle") cell.className = "handle-cell"; 241 cell.textContent = value; 242 } 243 ··· 250 251 updateStats(); 252 } 253 - 254 255 function updateStats() { 256 totalCount.textContent = DATA.length;
··· 16 } 17 18 body { 19 + font-family: 20 + -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 21 background: light-dark(#f5f5f5, #000); 22 padding: 20px; 23 } ··· 238 cell.className = "rank-cell"; 239 } else { 240 const value = item[col]; 241 + if (col.toLowerCase() === "handle") 242 + cell.className = "handle-cell"; 243 cell.textContent = value; 244 } 245 ··· 252 253 updateStats(); 254 } 255 256 function updateStats() { 257 totalCount.textContent = DATA.length;