Drupal Module: Yelp Search Results
I had a bit of free time recently, so I began reading up on some of the new API’s that different websites have come out with (Digg, Yelp, etc…). When I found the Yelp API it sparked an idea for a new Drupal module I could build.
Of course I first took a look around the drupal website to see if a module already existed, so I wouldnt waste my time, and suprisingly it did not. Excited I planned out what I wanted to have the module do (after reading Yelp’s extensive restrictions list of what you can/cant do with their API). Since I’ve had alot more practice developing modules since publishing my first one (callouts), I gave myself just 2 days to code, complete and publish this module.
So yesterday (August 12th 2009) I began working on it, and am excited to say I’ve completed the module and it’s just as good as I would of hoped.
Enough of the back story, onto the module itself:
Yelp Search Results
This Module uses the Yelp API to display search results in a block on your site.
The module creates a new block (‘yelp search results’) which you can place on your page from the block administer section.(Administer > Blocks).
For individual site pages (nodes) you can specify settings for the yelp block (Block title, location, search radius, maximum number of results and which yelp categories to search from).So you could display the 5 best rated Hotels near you on one page, and the 10 best bars near you on another page.
Initially the module will just display photo, name, rating, address & phone for each search result. The display of search results is completely themable and provides you with alot of information you can display (such as reviews, longitude & latitude, etc..) for a complete listing of variables available to you open ‘yelp-business.tpl.php’ and view the comments.
There are only 3 draw backs:
- You need a yelp API key to use this module (can get for free from http://www.yelp.com/developers/getting_started/api_access)
- If you have a very high traffic site, the module might stop working (yelp allows you 10,000 API calls per day).
- Per the Yelp API Terms of Use, you have to display the Yelp logo along with your results (the only part that is not themable.)
You can see an example of this module in action at: http://mike-miles.com/drupal/
A few screen shots
You can download the drupal module for your drupal site, from its offical module page: http://drupal.org/project/yelp





2 Responses so far
Miles Per Hour » Drupal Module: Yelp Search Results
August 14th, 2009
1:41 am
[...] More here: Miles Per Hour » Drupal Module: Yelp Search Results [...]
declan
October 21st, 2009
5:23 pm
Hi Mike – neat module!
I’m a Drupal newbie, so forgive my denseness, but I can get the individual page/node level search results to show, but I can’t seem to get the home page block to show. I go to Admin->blocks and can drag the Yelp box into the right sidebar, but it never shows.
I think this is more my ignorance with Drupal than anything wrong with your module. I bet I’m missing a set up screen for the home page that’s like the set up screen for the individual block pages. Where do I enter the Yelp key and set the initial location for the search for the main page?
Also – I’d like the search to be driven by zip code tags on the current page. I’ll hack into the code to see of the location can be derived from taxonomy rather than hard coded per page.
Thanks!
D