Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
added new yelp stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
fulton committed Feb 22, 2020
1 parent d90406b commit 0dcae27
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/com/andromeda/araserver/skills/Locdec.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@ private ArrayList<OutputModel> yelpSearch() {
ArrayList<OutputModel> returedval = new ArrayList<>();
// http client
OkHttpClient client2 = new OkHttpClient();
String url;
if (term == "") url = "https://api.yelp.com/v3/businesses/search?latitude=" + lat + "&longitude=" + log + "&limit=25&sort_by=rating";
else url = "https://api.yelp.com/v3/businesses/search?term=" + term + "&latitude=" + lat + "&longitude=" + log + "&limit=25&sort_by=rating";

//swo url in logs or on console
System.out.println("https://api.yelp.com/v3/businesses/search?term=" + term + "&latitude=" + lat + "&longitude=" + log + "&limit=25&sort_by=rating");
//new http request
Request request2 = new Request.Builder()
.url("https://api.yelp.com/v3/businesses/search?term=" + term + "&latitude=" + lat + "&longitude=" + log + "&limit=25&sort_by=rating")
.url(url)
.get()
.addHeader("Authorization", "Bearer " + System.getenv("YELPKEY"))
.addHeader("cache-control", "no-cache")
Expand Down

0 comments on commit 0dcae27

Please sign in to comment.