Skip to content

Commit

Permalink
Stop fetching NYC data.
Browse files Browse the repository at this point in the history
  • Loading branch information
thesoftwarephilosopher committed Aug 17, 2024
1 parent 39acc5c commit e3124c0
Show file tree
Hide file tree
Showing 3 changed files with 2,131 additions and 5 deletions.
8 changes: 3 additions & 5 deletions site/fetch-dataset.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
const url = 'https://data.cityofnewyork.us/api/views/25th-nujf/rows.json';
const { data: rawData } = await fetch(url).then(res => res.json());
const allNames = rawData.map((d: any) => d[11].toLowerCase());

const rows = await fetch('names.txt').then(res => res.text());
const names = rows.split(/\r?\n/).map(row => row.split(',')[0]);
export const data = new Map(
Map.groupBy<string, any>(allNames, (n: any) => n)
Map.groupBy<string, any>(names, (n: any) => n)
.entries()
.map(([k, v]) => [k, v.length])
);
Loading

0 comments on commit e3124c0

Please sign in to comment.