Where to get local results.....

stmadeveloper

New member
Aug 30, 2007
1,687
36
0
Figured it might not be a bad idea to start a thread on where to get some local results... and ways to parse the data.

Like "night clubs in Beaver City, Montana".

There is yelp, and yahoo has a local search service as well.

I wrote a little ap the other day to grab the images of some places for something I was building using yelp.

PHP:
<?php

$state = 'Montana';
$city = 'Beaver City';
$keyword = 'flesh light distributors';

$keyword = str_replace (" ", "%20", $keyword);
$state = str_replace (" ", "%20", $state);

$city = str_replace (" ", "%20", $city);
$yelpstring = file_get_contents("http://api.yelp.com/business_review_search?term=$keyword&location=$city$state&ywsid=xxxxxxxxxxxxxxx", true); 
$obj = json_decode($yelpstring, true);// Convert JSON from yelp return string

   foreach($obj[businesses] as $value){
       echo "<img border=0 src='".$value[photo_url]."'><br/>";
     
       echo "<hr>";
   }

?>