Skip to content

Commit

Permalink
Published Easy Yelp v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hoseinrafiei committed Jan 3, 2019
0 parents commit 6e89293
Show file tree
Hide file tree
Showing 17 changed files with 1,008 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/easy-yelp.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

389 changes: 389 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Hossein Rafiei

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
102 changes: 102 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Easy Yelp API Integration

**Easy Yelp** is a single file PHP client for [Yelp API](https://www.yelp.com/developers/documentation/v3/get_started).

### Installation
You can simply download the file and include it in your project.

### Usage
Include it in your project and create an instance.

```php
require 'yelp.php';
```

If you're using composer or autoloader then you don't need to include it manually. You just need to configure your autoloader tool.

```php
$yelp = new Yelp('YOUR_TOKEN');
$businesses = $yelp->businessSearch([
'location' => 'Los Angeles, CA',
'price' => '1,2,3',
'sort_by' => 'distance',
'limit' => '30',
])->getArray();
```

### Methods
#### [Business Search](https://www.yelp.com/developers/documentation/v3/business_search)
```php
$request = [];
$yelp->businessSearch($request)->getArray();
```
#### [Phone Search](https://www.yelp.com/developers/documentation/v3/business_search_phone)
```php
$request = [];
$yelp->businessPhoneSearch($request)->getArray();
```
#### [Transaction Search](https://www.yelp.com/developers/documentation/v3/transaction_search)
```php
$request = [];
$yelp->transactionSearch('delivery', $request)->getArray();
```
#### [Business Details](https://www.yelp.com/developers/documentation/v3/business)
```php
$businessId = 'blahblah';
$request = [];
$yelp->businessDetails($businessId, $request)->getArray();
```
#### [Business Match](https://www.yelp.com/developers/documentation/v3/business_match)
```php
$request = [];
$yelp->businessMatch($request)->getArray();
```
#### [Business Reviews](https://www.yelp.com/developers/documentation/v3/business_reviews)
```php
$businessId = 'blahblah';
$request = [];
$yelp->businessReviews($businessId, $request)->getArray();
```
#### [Autocomplete](https://www.yelp.com/developers/documentation/v3/autocomplete)
```php
$request = [];
$yelp->autocomplete($request)->getArray();
```
#### [Event Lookup](https://www.yelp.com/developers/documentation/v3/event)
```php
$eventId = 'blahblah';
$request = [];
$yelp->eventDetails($eventId, $request)->getArray();
```
#### [Event Search](https://www.yelp.com/developers/documentation/v3/event_search)
```php
$request = [];
$yelp->events($request)->getArray();
```
#### [Featured Event](https://www.yelp.com/developers/documentation/v3/featured_event)
```php
$request = [];
$yelp->featuredEvent($request)->getArray();
```
#### [All Categories](https://www.yelp.com/developers/documentation/v3/all_categories)
```php
$request = [];
$yelp->categories($request)->getArray();
```
#### [Category Details](https://www.yelp.com/developers/documentation/v3/category)
```php
$alias = 'blahblah';
$request = [];
$yelp->categoryDetails($alias, $request)->getArray();
```
### Errors
To check if you received an error from Yelp API or not you can use following functions.
```php
$businesses = $yelp->businessSearch($request)->getArray();
if($yelp->hasError()) // We have an error
{
echo $yelp->getError(); // Print the error message
}
```
### License
This software released under **MIT License**.
Loading

0 comments on commit 6e89293

Please sign in to comment.