| 1 | package WebService::Yelp::Neighborhood; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | ▶ | use base qw/Class::Accessor/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | __PACKAGE__->mk_ro_accessors(qw/city state name url/); | ||
| 8 | |||
| 9 | =head1 NAME | ||
| 10 | |||
| 11 | WebService::Yelp::Neighborhood - Yelp.com API Neighborhood Class | ||
| 12 | |||
| 13 | =head1 SYNOPSIS | ||
| 14 | |||
| 15 | use strict; | ||
| 16 | use WebService::Yelp; | ||
| 17 | |||
| 18 | my $yelp = WebService::Yelp->new({ywsid => 'XXXXXXXXXXXX'}); | ||
| 19 | |||
| 20 | my $biz_res = $yelp->search_review_hood({ | ||
| 21 | term => 'cream puffs', | ||
| 22 | location => 'San Francisco', | ||
| 23 | }; | ||
| 24 | for my $b (@{$biz_res->businesses()}) { | ||
| 25 | for my $n (@{$b->neighborhood()}) { | ||
| 26 | print $b->name . " is in the " . $n->name . " neighborhood\n"; | ||
| 27 | } | ||
| 28 | } | ||
| 29 | |||
| 30 | # or | ||
| 31 | |||
| 32 | my $hood_res = $yelp->search_neighborhood_location({ | ||
| 33 | location => | ||
| 34 | '1512 Shattuck Avenue, Berkeley, CA', | ||
| 35 | }); | ||
| 36 | |||
| 37 | for my $n (@{$hood_res->neighborhoods}) { | ||
| 38 | print "the " . $n->name . " neighborhood in " . $b->city . "\n"; | ||
| 39 | } | ||
| 40 | |||
| 41 | =head1 DESCRIPTION | ||
| 42 | |||
| 43 | Yelp's neighborhoods define specific area's of a city. You can see the | ||
| 44 | entire list here: | ||
| 45 | |||
| 46 | http://www.yelp.com/developers/documentation/neighborhood_list | ||
| 47 | |||
| 48 | Note that business searches currently only return the name and URL | ||
| 49 | portions within a particular business. The neighborhood search | ||
| 50 | functions also return the city and state fields. | ||
| 51 | |||
| 52 | =head1 METHODS (Read Only) | ||
| 53 | |||
| 54 | =head2 name | ||
| 55 | |||
| 56 | The name of the neighborhood. | ||
| 57 | |||
| 58 | =head2 city | ||
| 59 | |||
| 60 | The neighborhood's city. | ||
| 61 | |||
| 62 | =head2 state | ||
| 63 | |||
| 64 | The neighborhood's state. | ||
| 65 | |||
| 66 | =head2 url | ||
| 67 | |||
| 68 | The url linking to Yelp's main page for this neighborhood. | ||
| 69 | |||
| 70 | =cut | ||
| 71 | |||
| 72 | |||
| 73 | |||
| 74 | |||
| 75 | 1; | ||