/**
* simpleWeather
* http://simpleweatherjs.com
*
* A simple jQuery plugin to display the current weather
* information for any location using Yahoo! Weather.
*
* Developed by James Fleeting <@twofivethreetwo> <http://iwasasuperhero.com>
* Another project from monkeeCreate <http://monkeecreate.com>
**/
/*! simpleWeather v3.0.2 - http://simpleweatherjs.com */
! function (e) {
"use strict";
function t(e, t) {
return Math.round("f" === e ? 5 / 9 * (t - 32) : 1.8 * t + 32)
}
e.extend({
simpleWeather: function (i) {
i = e.extend({
location: "",
woeid: "",
unit: "f",
success: function () {},
error: function () {}
}, i);
var o = new Date,
n = "https://query.yahooapis.com/v1/public/yql?format=json&rnd=" + o.getFullYear() + o.getMonth() + o.getDay() + o.getHours() + "&diagnostics=true&callback=?&q=";
if ("" !== i.location) n += 'select * from weather.forecast where woeid in (select woeid from geo.placefinder where text="' + i.location + '" and gflags="R" limit 1) and u="' + i.unit + '"';
else {
if ("" === i.woeid) return i.error({
message: "Could not retrieve weather due to an invalid location."
}), !1;
n += "select * from weather.forecast where woeid=" + i.woeid + ' and u="' + i.unit + '"'
}
return e.getJSON(encodeURI(n), function (e) {
if (null !== e && null !== e.query && null !== e.query.results && "Yahoo! Weather Error" !== e.query.results.channel.description) {
var o, n = e.query.results.channel,
r = {}, s = ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW", "N"],
a = "https://s.yimg.com/os/mit/media/m/weather/images/icons/l/44d-100567.png";
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.