Last active
August 29, 2015 14:17
-
-
Save postazure/c4008ff59afaa04de1bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # lib/harvesters/yelp_harvester.rb | |
| class YelpHarvester | |
| def initialize restaurant | |
| yelp_business_id = get_yelp_id(restaurant.yelp_url) | |
| @yelp_data = Yelp.client.business(yelp_business_id) | |
| end | |
| def get_yelp_id url | |
| url.slice!("http://www.yelp.com/biz/") | |
| return url | |
| end | |
| def populate_data | |
| yelp_info = YelpInfo.new({ | |
| rating: @yelp_data.rating, | |
| }) | |
| yelp_info.save | |
| end | |
| def populate_tags | |
| # Saves Tags to restaurant | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment