A CLI Terminal app that calculates the savings based on how many days you've not smoked. The app scrapes cigarette prices based on: the brand of cigarettes & State excise laws. It then calculates the savings to date, and returns a list of what those savings equate to from the Amazon Gifts API.
Treat Yo Self!
Watch it live:
-- Ghost does not yet allow videos to be uploaded directly to a post. I don't want to use an iframe embed with youtube or vimeo. So instead I think it'll be more fun as a gif. Here's what I used:
https://giphy.com/create/gifmaker (Only up 10 seconds, so would have to chop it up);
http://ezgif.com/video-to-gif/ (Better customization);
Tech Stack: Ruby + CSS
Team: The amazing Erin Pettigrew & Myself.
- Built a CLI Terminal app in Ruby.
- Implemented Nokogiri to scrape cigarette prices per current state excise rates.
- Implemented logic to calculate savings, and calling on Amazon to determine different gifts that could be bought with the savings.
- Working with the Amazon Gifts API.
Challenges & Gotchas
- "New York" is different, even for web scrapers. Had some issues when the states had more than one word as a name.
- People who write CSS should make it easier to identify web elements on a page. I should write better names.
- First time coding with somebody else at the same time. Much fun!
- Learning how to narrow it down with CSS Selectors and leveraging the mighty Google Dev Tools
- Nokogiri for web scraping. Nuff said.
+ Found it easier to scrape the Amazon Gifts page as well for their top 25 lists and saving that to the database, would prefer API calls to Amazon based on categories.
+ Perhaps the ability to order from Amazon directly.