This was a fun one to build. So GitHub does not have an API endpoint for their trending page. So to work around this I used playwright to scrape the pages for various languages. Then I'd create a tab for a variety of language. What I ran into though was given the data likely doesn't change too often, going and scraping on every tab change was slow. To resolve this, I wrote a second script that runs on an hourly cron and then saves the data to a lowdb
database with the preloaded db
function. This now makes the main script run instantly as the entries are cached on my system.
Main Script:
Background puller script: