DoronShapiro/Penn-Laundry-API — pull request #2 by DoronShapiro (2013-05-20 23:49:23+00:00)
Title: Replace Cheerio DOM parsing with a regex-based hack, fixes #1

After I found that broken html on the scraped page was causing Cheerio to improperly parse it, I first tried writing a little function that would pre-process the raw html and fix the errors, but because most of their mistakes are either forgetting >'s or forgetting end tags, which made it hard for me to come up with rules that would distinguish markup from content.

I was able to scrape the data we needed by taking advantage of the fact that most of the information we need is by itself on a line in the html. The code works on all of the rooms I have tried it on, although it is fairly inefficient and not very flexible yet.

Thoughts?