diff --git a/commands/botinfo/info.js b/commands/botinfo/info.js index 6d71b1c5..fa7b9b32 100644 --- a/commands/botinfo/info.js +++ b/commands/botinfo/info.js @@ -57,11 +57,11 @@ module.exports = class InfoCommand extends commando.Command { .addField('Library', "[discord.js](https://discord.js.org/#/) / [commando](https://github.com/Gawdl3y/discord.js-commando)", true) .addField('Modules', - "[pirate-speak](https://github.com/mikewesthad/pirate-speak), [google-translate-api](https://github.com/matheuss/google-translate-api), [zalgoize](https://github.com/clux/zalgolize), [hepburn](https://github.com/lovell/hepburn), [yahoo-weather](https://github.com/mamal72/node-yahoo-weather), [string-to-binary](https://www.npmjs.com/package/string-to-binary), [roman-numeral-converter-mmxvi](https://github.com/Cein-Markey/roman-numeral-conversion-library), [cowsay](https://github.com/piuccio/cowsay), [morse](https://github.com/ecto/morse)") + "[pirate-speak](https://github.com/mikewesthad/pirate-speak), [google-translate-api](https://github.com/matheuss/google-translate-api), [zalgoize](https://github.com/clux/zalgolize), [hepburn](https://github.com/lovell/hepburn), [string-to-binary](https://www.npmjs.com/package/string-to-binary), [roman-numeral-converter-mmxvi](https://github.com/Cein-Markey/roman-numeral-conversion-library), [cowsay](https://github.com/piuccio/cowsay), [morse](https://github.com/ecto/morse)") .addField('Utility Modules', "[superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [opusscript](https://github.com/abalabahaha/opusscript), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/), [sherlockjs](https://github.com/maytis/sherlockjs)") .addField('APIs', - "[Wattpad API](https://developer.wattpad.com/docs/api), [Wordnik API](http://developer.wordnik.com/docs.html), [osu! API](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices API](http://docs.yugiohprices.apiary.io/#), [YouTube Data API](https://developers.google.com/youtube/v3/), [Yoda Speak API](https://market.mashape.com/ismaelc/yoda-speak), [Discord Bots API](https://bots.discord.pw/api), [Today in History API](http://history.muffinlabs.com/#api), [jService API](http://jservice.io/), [Strawpoll API](https://github.com/strawpoll/strawpoll/wiki/API), [Urban Dictionary API](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB API](http://www.omdbapi.com/)") + "[Wattpad API](https://developer.wattpad.com/docs/api), [Wordnik API](http://developer.wordnik.com/docs.html), [osu! API](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices API](http://docs.yugiohprices.apiary.io/#), [YouTube Data API](https://developers.google.com/youtube/v3/), [Yoda Speak API](https://market.mashape.com/ismaelc/yoda-speak), [Discord Bots API](https://bots.discord.pw/api), [Today in History API](http://history.muffinlabs.com/#api), [jService API](http://jservice.io/), [Strawpoll API](https://github.com/strawpoll/strawpoll/wiki/API), [Urban Dictionary API](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB API](http://www.omdbapi.com/), [Yahoo Weather API](https://developer.yahoo.com/weather/)") .addField('Other Credit', "[Heroku](https://www.heroku.com/), [Cloud9](https://c9.io/), [heroku-buildpack-ffmpeg-latest](https://elements.heroku.com/buildpacks/jonathanong/heroku-buildpack-ffmpeg-latest)") .addField('My Server', diff --git a/commands/search/forecast.js b/commands/search/forecast.js index 9776b6be..9bb7fc23 100644 --- a/commands/search/forecast.js +++ b/commands/search/forecast.js @@ -1,6 +1,6 @@ const commando = require('discord.js-commando'); const Discord = require('discord.js'); -const weather = require('yahoo-weather'); +const request = require('superagent'); module.exports = class ForecastCommand extends commando.Command { constructor(Client) { @@ -28,7 +28,9 @@ module.exports = class ForecastCommand extends commando.Command { console.log(`[Command] ${message.content}`); let locationToSearch = args.locationQ; try { - let info = await weather(locationToSearch, 'f'); + let response = await request + .get(`https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${locationToSearch}")&format=json`); + let info = response.body.query.results.channel; const embed = new Discord.RichEmbed() .setColor(0x0000FF) .setAuthor(info.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png') diff --git a/commands/search/weather.js b/commands/search/weather.js index 8af43c3a..884133be 100644 --- a/commands/search/weather.js +++ b/commands/search/weather.js @@ -27,39 +27,39 @@ module.exports = class WeatherCommand extends commando.Command { try { let response = await request .get(`https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where u='f' AND woeid in (select woeid from geo.places(1) where text="${locationToSearch}")&format=json`); + let info = response.body.query.results.channel; const embed = new Discord.RichEmbed() .setColor(0x0000FF) - .setAuthor(response.body.query.results.channel.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png') - .setURL(response.body.query.results.channel.link) + .setAuthor(info.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png') + .setURL(info.link) .setTimestamp() .addField('**City:**', - response.body.query.results.channel.location.city, true) + info.location.city, true) .addField('**Country**', - response.body.query.results.channel.location.country, true) + info.location.country, true) .addField('**Region:**', - response.body.query.results.channel.location.region, true) + info.location.region, true) .addField('**Condition:**', - response.body.query.results.channel.item.condition.text, true) + info.item.condition.text, true) .addField('**Temperature:**', - `${response.body.query.results.channel.item.condition.temp}°F`, true) + `${info.item.condition.temp}°F`, true) .addField('**Humidity:**', - response.body.query.results.channel.atmosphere.humidity, true) + info.atmosphere.humidity, true) .addField('**Pressure:**', - response.body.query.results.channel.atmosphere.pressure, true) + info.atmosphere.pressure, true) .addField('**Rising:**', - response.body.query.results.channel.atmosphere.rising, true) + info.atmosphere.rising, true) .addField('**Visibility:**', - response.body.query.results.channel.atmosphere.visibility, true) + info.atmosphere.visibility, true) .addField('**Wind Chill:**', - response.body.query.results.channel.wind.chill, true) + info.wind.chill, true) .addField('**Wind Direction:**', - response.body.query.results.channel.wind.direction, true) + info.wind.direction, true) .addField('**Wind Speed:**', - response.body.query.results.channel.wind.speed, true); + info.wind.speed, true); return message.embed(embed); } catch (err) { - console.log(err); return message.say(":x: Error! Make sure you typed the location correctly!"); } } diff --git a/html/carbondesc.html b/html/carbondesc.html index 0f9a29c6..1d1d2bb6 100644 --- a/html/carbondesc.html +++ b/html/carbondesc.html @@ -22,7 +22,6 @@
  • google-translate-api
  • zalgoize
  • hepburn
  • -
  • yahoo-weather
  • superagent
  • mathjs
  • string-to-binary
  • @@ -50,6 +49,7 @@
  • Strawpoll API
  • Urban Dictionary API
  • OMDB API
  • +
  • Yahoo Weather API
  • Information

    Information

    diff --git a/package.json b/package.json index f5e5bc9e..dac32281 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,6 @@ "roman-numeral-converter-mmxvi": "^1.0.5", "string-to-binary": "^0.1.2", "superagent": "^3.5.1", - "yahoo-weather": "^2.2.2", "zalgolize": "^1.2.4" } }