var request = require('request');
var keys = require('./keys.js');
var qs = require('querystring');
var bb = require('bluebird');

const URL = 'https://maps.googleapis.com/maps/api/directions/json';



module.exports = {
  /*
   * Input: (String, String, Function) 
   * Output: Object
   * Description: Given a starting and ending address, gives an object
   *              containing an array of routes.
   */
  getRoutes: function (origin, destination, callback) {
    
    // Concatenate query parameters into HTTP request friendly string.
    let queryString = qs.stringify({
      origin: origin,
      destination: destination,
      key: keys.googleMaps
    });

    // Specify parameters for request.
    let options = {
      url: `${URL}?${queryString}`,
      method: 'GET'
    }; 
 
    // Make request to Google Directions API.
    request(options, (error, results) => {
      error ? callback(error) : callback(results);
    });
  }

};
@@ -1,12 +1,42 @@
+var bb = require('bluebird');%0A
 var request 
@@ -37,16 +37,29 @@
 quest = 
+bb.promisify(
 require(
@@ -68,16 +68,17 @@
 equest')
+)
 ;%0Avar ke
@@ -137,26 +137,28 @@
 ring');%0Avar 
-bb
+Yelp
  = require('
@@ -153,32 +153,55 @@
  = require('
-bluebird
+yelp');%0Avar _ = require('lodash
 ');%0A%0Aconst U
@@ -199,16 +199,21 @@
 %0A%0Aconst 
+gmaps
 URL = 'h
@@ -267,16 +267,174 @@
 json';%0A%0A
+var yelp = new Yelp(%7B%0A  'consumer_key': keys.yelp,%0A  'consumer_secret': keys.yelpSecret,%0A  'token': keys.yelpToken,%0A  'token_secret': keys.yelpTokenSecret%0A%7D);
 %0A%0Amodule
@@ -508,14 +508,15 @@
 ut: 
-Object
+Promise
 %0A   
@@ -630,16 +630,32 @@
 f routes
+ in promise form
 .%0A   */%0A
@@ -700,26 +700,11 @@
 tion
-, callback) %7B%0A    
+) %7B
 %0A   
@@ -971,16 +971,21 @@
 url: %60$%7B
+gmaps
 URL%7D?$%7Bq
@@ -1078,16 +1078,23 @@
 PI.%0A    
+return 
 request(
@@ -1104,94 +1104,254 @@
 ions
-, (error, results) =%3E %7B%0A      error ? callback(error) : callback(results);%0A    %7D);%0A  %7D%0A%0A%7D;
+);%0A  %7D,%0A%0A  /*%0A   * Input: Object%0A   * Output: Promise%0A   * Description: Takes a parameters object and returns a list%0A   *              of yelp provided data.%0A   */%0A  getRestaurants: (customParams) =%3E %7B%0A    return yelp.search(customParams);%0A  %7D,%0A%7D;%0A%0A%0A

Implement yelp queries