| WebService-Yelp documentation | Contained in the WebService-Yelp distribution. |
WebService::Yelp::Neighborhood - Yelp.com API Neighborhood Class
use strict;
use WebService::Yelp;
my $yelp = WebService::Yelp->new({ywsid => 'XXXXXXXXXXXX'});
my $biz_res = $yelp->search_review_hood({
term => 'cream puffs',
location => 'San Francisco',
};
for my $b (@{$biz_res->businesses()}) {
for my $n (@{$b->neighborhood()}) {
print $b->name . " is in the " . $n->name . " neighborhood\n";
}
}
# or
my $hood_res = $yelp->search_neighborhood_location({
location =>
'1512 Shattuck Avenue, Berkeley, CA',
});
for my $n (@{$hood_res->neighborhoods}) {
print "the " . $n->name . " neighborhood in " . $b->city . "\n";
}
Yelp's neighborhoods define specific area's of a city. You can see the entire list here:
http://www.yelp.com/developers/documentation/neighborhood_list
Note that business searches currently only return the name and URL portions within a particular business. The neighborhood search functions also return the city and state fields.
The name of the neighborhood.
The neighborhood's city.
The neighborhood's state.
The url linking to Yelp's main page for this neighborhood.
| WebService-Yelp documentation | Contained in the WebService-Yelp distribution. |
package WebService::Yelp::Neighborhood; use strict; use warnings; use base qw/Class::Accessor/; __PACKAGE__->mk_ro_accessors(qw/city state name url/);
1;