~/talk

Finding a lost song with Node.js & async iterators

Talkat CityJS Athens 2022 · 2022-05-25..05-27· [nodejs, javascript]
slides:none on file

Uses Node.js and undici to crawl 250,000 Last.fm scrobbles, hits a weird pagination bug where API reports 50 records per page but returns 51 and shows duplicated entries from a sliding-window race. Switches from page counters to the timestamp `to` parameter to avoid duplicates, implements an async generator reader that yields each page, then runs a keyword scan and after about 30 minutes surfaces the forgotten track from nine years ago. Code and exercises are open source.

AI-written summary · about

  1. 0:00Introduction and problem
  2. 1:53Exploring the Last.fm API
  3. 4:59Initial data fetching issues
  4. 7:06Fixing pagination with time-based windowing
  5. 9:11Turning solution into a library
  6. 12:21Async iterators vs callbacks
  7. 13:26Iterator vs iterable explained
  8. 16:14Generators for iteration
  9. 18:23Async iterator protocol
  10. 20:28Async generators
  11. 22:10Building the reader library
  12. 23:16Searching for the lost song
  13. 23:57Finding the song
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.