3.6 foundation and unwrapping promises

5h Today I did a bunch of Launch Academy stuff with learning Foundation and dom manipulation. I also started some late night work on the craigslist scraper and I had a lot of good ideas but they were all bigger than the time I had 🙁 My latest one was that I want to scrape more that one search and put them all on the same page. My issue with that is that I need to res.send to be within the promise .then handler, and I need to process more than one promise before I can send the page.

In a funny twist of fate, just writing the previous line helped me figure out what I needed to do. Since I’m processing a list of urls all I need to do is check inside of the promise loop if we are at the last url. If so, then return the data I have collected so far! That was simple!

The next thing is going to be how to add a button that will add a post id to the blocked list. This shouldn’t be hard, but I’m still building this entirely in express so there is a lot of hardcoded html in there. I should probably start transitioning to react for the frontend code. Oh, I also started playing around with diskDb based on something wes bos said. I haven’t gotten it up and running yet either but I have created a db and written to it. It seems super simple. And I’m going to make a nav bar pretty soon using foundation. So many things! And Launch Academy starts on monday!!

Tell me what you think.

This site uses Akismet to reduce spam. Learn how your comment data is processed.