Remove yahoo-weather entirely

This commit is contained in:
Daniel Odendahl Jr
2017-04-02 04:24:02 +00:00
parent c8a48bd935
commit f575b9d708
6 changed files with 23 additions and 22 deletions
+2 -2
View File
@@ -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',
+4 -2
View File
@@ -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')
+15 -15
View File
@@ -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!");
}
}
+1 -1
View File
@@ -22,7 +22,6 @@
<li><a href="https://github.com/matheuss/google-translate-api">google-translate-api</a></li>
<li><a href="https://github.com/clux/zalgolize">zalgoize</a></li>
<li><a href="https://github.com/lovell/hepburn">hepburn</a></li>
<li><a href="https://github.com/mamal72/node-yahoo-weather">yahoo-weather</a></li>
<li><a href="https://github.com/visionmedia/superagent">superagent</a></li>
<li><a href="http://mathjs.org/">mathjs</a></li>
<li><a href="https://www.npmjs.com/package/string-to-binary">string-to-binary</a></li>
@@ -50,6 +49,7 @@
<li><a href="https://github.com/strawpoll/strawpoll/wiki/API">Strawpoll API</a></li>
<li><a href="https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation">Urban Dictionary API</a></li>
<li><a href="http://www.omdbapi.com/">OMDB API</a></li>
<li><a href="https://developer.yahoo.com/weather/">Yahoo Weather API</a></li>
</ul>
<h2>Information</h2>
<ul>
+1 -1
View File
@@ -71,7 +71,6 @@
<li><a href="https://github.com/matheuss/google-translate-api">google-translate-api</a></li>
<li><a href="https://github.com/clux/zalgolize">zalgoize</a></li>
<li><a href="https://github.com/lovell/hepburn">hepburn</a></li>
<li><a href="https://github.com/mamal72/node-yahoo-weather">yahoo-weather</a></li>
<li><a href="https://github.com/visionmedia/superagent">superagent</a></li>
<li><a href="http://mathjs.org/">mathjs</a></li>
<li><a href="https://www.npmjs.com/package/string-to-binary">string-to-binary</a></li>
@@ -99,6 +98,7 @@
<li><a href="https://github.com/strawpoll/strawpoll/wiki/API">Strawpoll API</a></li>
<li><a href="https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation">Urban Dictionary API</a></li>
<li><a href="http://www.omdbapi.com/">OMDB API</a></li>
<li><a href="https://developer.yahoo.com/weather/">Yahoo Weather API</a></li>
</ul>
</ul>
<h2>Information</h2>
-1
View File
@@ -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"
}
}