Bizratr

Synthesize business information from many sources


Project maintained by bmuller Hosted on GitHub Pages — Theme by mattgraham

BizRatr

This gem pulls in business data from a variety of sources and synthesizes a singular view of the business. Right now Facebook, Yelp, Factual, Google Places, and Foursquare are used as sources. Bizratr will collapse all of the matching sources into a singular view of each matching business (businesses from each source are intelligently merged into the lists from the other sources, so that there is one record per business).

>> require 'bizratr'
>> config = { 
     :foursquare => { :client_id => 'anid', :client_secret => 'asecret' },
     :yelp => { :consumer_key => 'akey', :consumer_secret => 'asecret', 
                :token => 'atoken', :token_secret => 'atokensecret' },
     :google_places => { :key => "akey" },
     :factual => { :key => 'akey', :secret => 'asecret' },
     :facebook => { :key => 'akey', :secret => 'asecret' }
   }
>> finder = BizRatr::UberClient.new(config)
>> location = [40.729401, -73.996061] # this could be an address
>> name = "third rail coffee"
>> matches = finder.search_location(location, name)
>> matches.first.rating # this will be an average across sources
 => 4.55
>> matches.first.flattened_categories
 => ["coffee shop", "food", "food & beverage > cafes", "coffee houses & tea houses"]
>> match = finder.search_location_strictly(location, name) # best name match
 => <Business [name=Third Rail Coffee, phone=6468250812, address=240 Sull...>
>> match.total_users # total users who have checked in using any service
 => 8710
>> match.total_reviews
 => 183
>> match.total_checkins
 => 8710
>> match.total_likes
 => 0
>> match.phone
 => 6468250812
>> match.website_normalized
 => "http://thirdrailcoffee.com"
>> match.website_likes
 => {"share_count"=>75, "like_count"=>10, "comment_count"=>9, "click_count"=>6}

In this example, the average of the ratings from any of the sources (normalized to a 5 point scale) is used as the rating. Each result has address information, rating information, "like" information, and other relevant info. Businesses that are returned from each search are merged, with matching results squashed (based on name/location/phone/etc).

You only need to specify the config options for the services you actually want to query. You can sign up for each at the following locations:

License

The bizratr code is distributed under the GPLv3.