'use strict';

const tokens = require('./token.js');
const rp = require('request-promise');

const get = (link) => {
  const wuURL = 'http://api.wunderground.com/api/' + tokens.WU_TOKEN + '/';
  const API = 'condition';
  const fullURL = wuURL + API + link;
  return rp({
    uri: fullURL,
    method: 'GET'
  });
};

const location = (query) => {
  return rp({
    uri: 'http://autocomplete.wunderground.com/aq',
    method: 'GET',
    qs: {
      query: query
    }
  });
};

module.exports = {
  loc: location,
  get: get
};

@@ -301,16 +301,75 @@
 : 'GET'%0A
+  %7D).then((response) =%3E %7B%0A    return JSON.parse(response);%0A
   %7D);%0A%7D;
@@ -520,16 +520,75 @@
 y%0A    %7D%0A
+  %7D).then((response) =%3E %7B%0A    return JSON.parse(response);%0A
   %7D);%0A%7D;

Update weather.js