chadselph / karaokesearch

Search a karaoke songbook.
0 stars 0 forks source link

Assistance #1

Open thethomasbeck opened 6 years ago

thethomasbeck commented 6 years ago

Hi, I was wondering if you could assist with the breakdown of the API-Gateway --> Lambda flow, that pulls the songs. I know you mentioned the songlist is scraped from http://djpurple.com/blog/songbook/

Are you just doing a request to that URL for the list of songs?

I am trying to do something similar, but either use DynamoDB with the list of songs, or pull from a CSV file that I maintain.

If this is not something that matches what you are doing here, or something you can assist with, no worries, this was just the only example i could find online so far :D

chadselph commented 6 years ago

I've gone back and forth on a bunch of approaches. Originally I just had a scrapping script I would run and checkin the hard-coded JSON into source control. It was too tedious to keep this in sync so I moved the scraper to lambda and it happens on-demand. Only downside is that lambda takes a while to startup. I first wrote it in Scala, but thought the JVM startup time was why lambda is slow (the scraping takes about 100ms on my laptop, but more than 10 seconds on aws), so I rewrote it in javascript; but it was just as slow there.