Skip to content

Commit 048c220

Browse files
author
Wellington Moreno
authored
Merge pull request #11 from RedRoma/develop
Release 1.0
2 parents 0f1a571 + 9615848 commit 048c220

45 files changed

Lines changed: 7619 additions & 3 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@
1010

1111
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
1212
hs_err_pid*
13+
/target/
14+
/nbproject/

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sudo: required
2+
language: java
3+
jdk:
4+
- oraclejdk8
5+
6+
before_install:
7+
- sudo apt-get update -qq
8+
- sudo apt-get update && sudo apt-get install oracle-java8-installer
9+
- java -version

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright {yyyy} {name of copyright owner}
189+
Copyright {2016} {RedRoma, Inc.}
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 127 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,127 @@
1-
# YelpJavaClient
2-
Provides a convenient Java Client Library for interfacing with Yelp
1+
YelpJavaClient
2+
===================
3+
4+
[<img src="http://brand.redroma.tech/Logos/RedRoma-Logo%402x.png" width="300">](http://RedRoma.tech)
5+
6+
[![Jenkins](http://jenkins.redroma.tech/job/YelpAPI/badge/icon)](http://jenkins.redroma.tech/job/YelpAPI/) [![Travis](https://travis-ci.org/RedRoma/YelpJavaClient.svg?branch=develop)](https://travis-ci.org/RedRoma/YelpJavaClient)
7+
8+
---
9+
10+
The **YelpJavaClient** provides
11+
12+
## Download
13+
14+
### Maven
15+
16+
```xml
17+
<dependency>
18+
<groupId>tech.redroma.yelp</groupId>
19+
<artifactId>yelp-api</artifactId>
20+
<version>1.0</version>
21+
</dependency>
22+
```
23+
24+
## Creating a Client
25+
26+
Create a client using the App ID and App Secret that you obtained from the [Yelp Developer console](https://www.yelp.com/developers/v3/manage_app).
27+
28+
```java
29+
String clientId = "...";
30+
String clientSecret = "...";
31+
YelpAPI yelp = YelpAPI.newInstance(clientId, clientSecret);
32+
```
33+
34+
## Searching Businesses
35+
36+
#### [Yelp API Documentation](https://www.yelp.com/developers/documentation/v3/business_search)
37+
38+
39+
Searching businesses is as easy as making a request object and using the `searchForBusinesses()` method.
40+
41+
```java
42+
//Create a request object
43+
YelpSearchRequest request = YelpSearchRequest.newBuilder()
44+
.withSearchTerm("Deli")
45+
.withCoordinate(Coordinate.of(34.018363, -118.492343))
46+
.withLimit(10)
47+
.withSortBy(YelpSearchRequest.SortType.DISTANCE)
48+
.build();
49+
50+
//Make the request
51+
List<YelpBusiness> results = yelp.searchForBusinesses(request);
52+
53+
LOG.info("Found {} results for request {}", results.size(), request);
54+
```
55+
56+
57+
## Business Details
58+
59+
#### [Yelp API Documentation](https://www.yelp.com/developers/documentation/v3/business)
60+
61+
62+
Sometimes you want more detailed information about a business, such as the business hours, additional photos, and price information.
63+
64+
Simply call the `getBusinessDetails()` method.
65+
66+
```java
67+
//Using any business
68+
YelpBusiness business = Lists.oneOf(results);
69+
70+
//Make the request to get business details.
71+
YelpBusinessDetails businessDetails = yelp.getBusinessDetails(business);
72+
73+
LOG.info("Received detailed info for business named {}: [{}]", business.name, businessDetails);
74+
75+
if (businessDetails.isOpenNow())
76+
{
77+
LOG.info("{} is open now.", businessDetails.name)
78+
}
79+
```
80+
81+
## Reviews
82+
83+
#### [Yelp API Documentation](https://www.yelp.com/developers/documentation/v3/business_reviews)
84+
85+
86+
```java
87+
YelpBusiness business = Lists.oneof(business);
88+
List<YelpReview> reviews = yelp.getReviewsForBusiness(business);
89+
90+
LOG.info("Business named")
91+
```
92+
93+
## [Javadocs](http://www.javadoc.io/doc/tech.redroma.yelp/yelp-api/)
94+
95+
## Currently Unsupported
96+
97+
We do not yet support the following API calls:
98+
99+
+ [Phone Search](https://www.yelp.com/developers/documentation/v3/business_search_phone)
100+
+ [Transaction Search](https://www.yelp.com/developers/documentation/v3/transactions_search)
101+
+ [Autocomplete](https://www.yelp.com/developers/documentation/v3/autocomplete)
102+
103+
## Guiding Philosophy
104+
105+
We used [**Alchemy Design Principles**](https://github.com/SirWellington/alchemy) when designing this library.
106+
107+
[<img src="https://raw.githubusercontent.com/SirWellington/alchemy/develop/Graphics/Logo/Alchemy-Logo-v7-name.png" width="200">](https://github.com/SirWellington/alchemy)
108+
109+
### Swift
110+
We wanted our code to feel like it was barely there. This meant keeping things minimal and light.
111+
112+
### Intuitive
113+
Yelp already designed a great intuitive API. We didn't want to add a pool of unnecessary soda.
114+
115+
### Solid
116+
Nearly everything is unit tested, and it is already being used in production by [BlackNectar](http://docs.blacknectarapi.apiary.io/), and others.
117+
118+
### Invigorating
119+
We wanted you to have fun, and to feel powerful.
120+
We ditched the no-fun java `get() set()` pojo style in favor of open `public`
121+
variables. We trust you.
122+
123+
# License
124+
125+
This Software is licensed under the Apache 2.0 License
126+
127+
http://www.apache.org/licenses/LICENSE-2.0

0 commit comments

Comments
 (0)