diff --git a/JavaScript/Levenshtein_distance/index.js b/JavaScript/Levenshtein_distance/index.js new file mode 100644 index 0000000..8a655cb --- /dev/null +++ b/JavaScript/Levenshtein_distance/index.js @@ -0,0 +1,36 @@ +/** + * @param {string} a + * @param {string} b + */ +module.exports.distance = function(a, b) { + aL = a.length; + bL = b.length; + + if (aL == 0) return aL; + if (bL == 0) return bL; + + let matrix = []; + + for (let i = 0; i <= bL; i++) { + matrix[i] = [i]; + } + + for (let i = 0; i <= aL; i++) { + matrix[0][i] = i; + } + + for (let i = 1; i <= bL; i++) { + for (let j = 1; j <= aL; j++) { + if (b.charAt(i-1) == a.charAt(j-1)) { + matrix[i][j] = matrix[i-1][j-1]; + } else { + matrix[i][j] = Math.min(matrix[i-1][j-1] + 1, + Math.min(matrix[ i ][j-1] + 1, + matrix[i-1][j] + 1)); + } + } + } + + return matrix[bL][aL]; +} +// we're doing the matrix implimentation https://en.wikipedia.org/wiki/Levenshtein_distance diff --git a/JavaScript/Levenshtein_distance/package.json b/JavaScript/Levenshtein_distance/package.json new file mode 100644 index 0000000..b052249 --- /dev/null +++ b/JavaScript/Levenshtein_distance/package.json @@ -0,0 +1,11 @@ +{ + "name": "levenshtein-distance-finder", + "version": "1.0.0", + "description": "Implimentation of the Levenshtin distance algorithm", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "Ben (plane000)", + "license": "MIT" +} diff --git a/JavaScript/Levenshtein_distance/test.js b/JavaScript/Levenshtein_distance/test.js new file mode 100644 index 0000000..241cd49 --- /dev/null +++ b/JavaScript/Levenshtein_distance/test.js @@ -0,0 +1,4 @@ +const test = require('./index'); + +console.log(test.distance('stats', 'status')); +// expected output => 3 diff --git a/JavaScript/MinecraftFaceGetter/images/zirshock.png b/JavaScript/MinecraftFaceGetter/images/zirshock.png new file mode 100644 index 0000000..90325eb Binary files /dev/null and b/JavaScript/MinecraftFaceGetter/images/zirshock.png differ diff --git a/JavaScript/MinecraftFaceGetter/names.txt b/JavaScript/MinecraftFaceGetter/names.txt index ec0f78f..fca4b81 100644 --- a/JavaScript/MinecraftFaceGetter/names.txt +++ b/JavaScript/MinecraftFaceGetter/names.txt @@ -34,5 +34,6 @@ Fiomide BigLittle TinRobit steamtrap +zirshock soapibubbles plane000 \ No newline at end of file diff --git a/JavaScript/weather-api-resolver/client/css/style.css b/JavaScript/weather-api-resolver/client/css/style.css new file mode 100644 index 0000000..afc190a --- /dev/null +++ b/JavaScript/weather-api-resolver/client/css/style.css @@ -0,0 +1,55 @@ +@import url('https://fonts.googleapis.com/css?family=Roboto:400,100'); + +a { + color: inherit; + text-decoration: none; +} + +body { + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + background: rgb(245, 245, 245); + font-family: 'Roboto', sans-serif; + color: #2f2f2f; + font-size: 16px; +} + +.container { + position: absolute; + top: 20px; + width: 20%; + left: 20%; + text-align: center; +} + +.inputs { + text-align: left; + position: absolute; + top: 30px; +} + +.box { + position: absolute; + left: 100px; +} + +.currently { + font-weight: lighter; +} + +.update { + background-color: rgb(94, 145, 228); /* Green */ + border: none; + color: white; + padding: 15px 32px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; +} + +.update:hover { + background-color: rgb(67, 118, 194); +} diff --git a/JavaScript/weather-api-resolver/client/index.html b/JavaScript/weather-api-resolver/client/index.html new file mode 100644 index 0000000..4823032 --- /dev/null +++ b/JavaScript/weather-api-resolver/client/index.html @@ -0,0 +1,32 @@ + + + + + + Weather + + + + +
+
+
+
+ Celsius: + +
+
+ longitude: + +
+
+ latitude: + +

+ +
+ + +
+ + diff --git a/JavaScript/weather-api-resolver/client/main.js b/JavaScript/weather-api-resolver/client/main.js new file mode 100644 index 0000000..6f58591 --- /dev/null +++ b/JavaScript/weather-api-resolver/client/main.js @@ -0,0 +1,27 @@ +async function update() { + let celsius = document.getElementById('celsius').checked; + let lat = document.getElementById('lat').value; + let long = document.getElementById('long').value; + + if (lat == '' || long == '') { + document.getElementById('Currently').innerHTML ='You have not enterd any coordinates'; + return; + } + + let http = new XMLHttpRequest(); + + http.onreadystatechange = function() { + document.getElementById('Currently').innerHTML = 'loading...'; + let response = this.responseText; + document.getElementById('Currently').innerHTML = response; + } + + let string = '/weather?lat=' + lat + '&long=' + long; + + if (!celsius) { + string += '&celsius=false' + } + + await http.open('GET', string, true); + await http.send(); +} diff --git a/JavaScript/weather-api-resolver/helper.txt b/JavaScript/weather-api-resolver/helper.txt new file mode 100644 index 0000000..13e4235 --- /dev/null +++ b/JavaScript/weather-api-resolver/helper.txt @@ -0,0 +1,1634 @@ +https://api.darksky.net/forecast/key/coords/ +key: ba238ec11435fbe60c52887be53ecc36 +coords: 51.1093005,0.56643 +args: ?units=auto -- si = metric -- us = imperial + +{ + "latitude":37.8267, + "longitude":-122.4233, + "timezone":"America/Los_Angeles", + "currently":{ + "time":1531241404, + "summary":"Clear", + "icon":"clear-day", + "nearestStormDistance":133, + "nearestStormBearing":134, + "precipIntensity":0, + "precipProbability":0, + "temperature":67.67, + "apparentTemperature":67.67, + "dewPoint":52.17, + "humidity":0.58, + "pressure":1017.04, + "windSpeed":3.28, + "windGust":6.87, + "windBearing":233, + "cloudCover":0.06, + "uvIndex":3, + "visibility":10, + "ozone":307.15 + }, + "minutely":{ + "summary":"Clear for the hour.", + "icon":"clear-day", + "data":[ + { + "time":1531241400, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531241460, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531241520, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531241580, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531241640, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531241700, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531241760, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531241820, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531241880, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531241940, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242000, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242060, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242120, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242180, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242240, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242300, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242360, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242420, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242480, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242540, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242600, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242660, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242720, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242780, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242840, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242900, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531242960, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243020, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243080, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243140, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243200, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243260, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243320, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243380, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243440, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243500, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243560, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243620, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243680, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243740, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243800, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243860, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243920, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531243980, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244040, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244100, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244160, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244220, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244280, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244340, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244400, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244460, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244520, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244580, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244640, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244700, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244760, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244820, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244880, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531244940, + "precipIntensity":0, + "precipProbability":0 + }, + { + "time":1531245000, + "precipIntensity":0, + "precipProbability":0 + } + ] + }, + "hourly":{ + "summary":"Mostly cloudy starting tonight.", + "icon":"partly-cloudy-night", + "data":[ + { + "time":1531238400, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":65.13, + "apparentTemperature":65.13, + "dewPoint":52.05, + "humidity":0.63, + "pressure":1017.19, + "windSpeed":3.1, + "windGust":6.47, + "windBearing":239, + "cloudCover":0.08, + "uvIndex":2, + "visibility":10, + "ozone":308.33 + }, + { + "time":1531242000, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":68.17, + "apparentTemperature":68.17, + "dewPoint":52.17, + "humidity":0.57, + "pressure":1017.01, + "windSpeed":3.32, + "windGust":6.95, + "windBearing":231, + "cloudCover":0.06, + "uvIndex":4, + "visibility":10, + "ozone":306.92 + }, + { + "time":1531245600, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":70.1, + "apparentTemperature":70.1, + "dewPoint":52.43, + "humidity":0.54, + "pressure":1016.78, + "windSpeed":4.57, + "windGust":8.47, + "windBearing":255, + "cloudCover":0.05, + "uvIndex":6, + "visibility":10, + "ozone":305.89 + }, + { + "time":1531249200, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":71.67, + "apparentTemperature":71.67, + "dewPoint":52.83, + "humidity":0.52, + "pressure":1016.32, + "windSpeed":6.13, + "windGust":10.83, + "windBearing":269, + "cloudCover":0.04, + "uvIndex":9, + "visibility":10, + "ozone":305.57 + }, + { + "time":1531252800, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":72.98, + "apparentTemperature":72.98, + "dewPoint":53.22, + "humidity":0.5, + "pressure":1015.94, + "windSpeed":8.17, + "windGust":12.88, + "windBearing":259, + "cloudCover":0.04, + "uvIndex":11, + "visibility":10, + "ozone":305.62 + }, + { + "time":1531256400, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0.0005, + "precipProbability":0.01, + "precipType":"rain", + "temperature":73.88, + "apparentTemperature":73.88, + "dewPoint":53.37, + "humidity":0.49, + "pressure":1015.21, + "windSpeed":9.59, + "windGust":15.72, + "windBearing":265, + "cloudCover":0.05, + "uvIndex":10, + "visibility":10, + "ozone":305.74 + }, + { + "time":1531260000, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0.0015, + "precipProbability":0.01, + "precipType":"rain", + "temperature":73.69, + "apparentTemperature":73.69, + "dewPoint":53.57, + "humidity":0.49, + "pressure":1014.82, + "windSpeed":10.51, + "windGust":18.12, + "windBearing":265, + "cloudCover":0.05, + "uvIndex":8, + "visibility":10, + "ozone":305.83 + }, + { + "time":1531263600, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":72.46, + "apparentTemperature":72.46, + "dewPoint":53.68, + "humidity":0.52, + "pressure":1014.34, + "windSpeed":11.17, + "windGust":19.67, + "windBearing":270, + "cloudCover":0.04, + "uvIndex":5, + "visibility":10, + "ozone":305.9 + }, + { + "time":1531267200, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0.0012, + "precipProbability":0.01, + "precipType":"rain", + "temperature":70.51, + "apparentTemperature":70.51, + "dewPoint":53.84, + "humidity":0.56, + "pressure":1013.97, + "windSpeed":11.07, + "windGust":19.48, + "windBearing":269, + "cloudCover":0.04, + "uvIndex":3, + "visibility":10, + "ozone":305.94 + }, + { + "time":1531270800, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":68.24, + "apparentTemperature":68.24, + "dewPoint":53.97, + "humidity":0.6, + "pressure":1013.48, + "windSpeed":10.35, + "windGust":18.08, + "windBearing":266, + "cloudCover":0.04, + "uvIndex":1, + "visibility":10, + "ozone":305.83 + }, + { + "time":1531274400, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":65.51, + "apparentTemperature":65.51, + "dewPoint":54.1, + "humidity":0.67, + "pressure":1013, + "windSpeed":9.57, + "windGust":16.99, + "windBearing":257, + "cloudCover":0.05, + "uvIndex":1, + "visibility":10, + "ozone":305.63 + }, + { + "time":1531278000, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0.0016, + "precipProbability":0.01, + "precipType":"rain", + "temperature":63.09, + "apparentTemperature":63.09, + "dewPoint":54.24, + "humidity":0.73, + "pressure":1012.89, + "windSpeed":8.74, + "windGust":16.3, + "windBearing":255, + "cloudCover":0.1, + "uvIndex":0, + "visibility":10, + "ozone":305.37 + }, + { + "time":1531281600, + "summary":"Clear", + "icon":"clear-night", + "precipIntensity":0.0012, + "precipProbability":0.01, + "precipType":"rain", + "temperature":61.52, + "apparentTemperature":61.52, + "dewPoint":54.46, + "humidity":0.78, + "pressure":1012.96, + "windSpeed":7.32, + "windGust":13.59, + "windBearing":258, + "cloudCover":0.16, + "uvIndex":0, + "visibility":10, + "ozone":305.02 + }, + { + "time":1531285200, + "summary":"Clear", + "icon":"clear-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":60.41, + "apparentTemperature":60.41, + "dewPoint":54.64, + "humidity":0.81, + "pressure":1013.36, + "windSpeed":7.51, + "windGust":13.04, + "windBearing":229, + "cloudCover":0.2, + "uvIndex":0, + "visibility":10, + "ozone":304.48 + }, + { + "time":1531288800, + "summary":"Clear", + "icon":"clear-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":59.24, + "apparentTemperature":59.24, + "dewPoint":54.92, + "humidity":0.86, + "pressure":1013.37, + "windSpeed":6.8, + "windGust":11.36, + "windBearing":242, + "cloudCover":0.23, + "uvIndex":0, + "visibility":10, + "ozone":303.9 + }, + { + "time":1531292400, + "summary":"Partly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":58.27, + "apparentTemperature":58.27, + "dewPoint":55.14, + "humidity":0.89, + "pressure":1013.59, + "windSpeed":6.51, + "windGust":10.42, + "windBearing":240, + "cloudCover":0.41, + "uvIndex":0, + "visibility":10, + "ozone":303.24 + }, + { + "time":1531296000, + "summary":"Partly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":57.75, + "apparentTemperature":57.75, + "dewPoint":55.13, + "humidity":0.91, + "pressure":1013.11, + "windSpeed":6.17, + "windGust":9.92, + "windBearing":233, + "cloudCover":0.54, + "uvIndex":0, + "visibility":10, + "ozone":302.49 + }, + { + "time":1531299600, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":57.24, + "apparentTemperature":57.24, + "dewPoint":55.08, + "humidity":0.93, + "pressure":1012.82, + "windSpeed":6.15, + "windGust":9.45, + "windBearing":229, + "cloudCover":0.64, + "uvIndex":0, + "visibility":10, + "ozone":301.89 + }, + { + "time":1531303200, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":56.77, + "apparentTemperature":56.77, + "dewPoint":55, + "humidity":0.94, + "pressure":1012.46, + "windSpeed":5.91, + "windGust":8.84, + "windBearing":229, + "cloudCover":0.7, + "uvIndex":0, + "visibility":10, + "ozone":301.57 + }, + { + "time":1531306800, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":55.97, + "apparentTemperature":55.97, + "dewPoint":54.89, + "humidity":0.96, + "pressure":1012.23, + "windSpeed":5.88, + "windGust":8.22, + "windBearing":208, + "cloudCover":0.75, + "uvIndex":0, + "visibility":9.16, + "ozone":301.46 + }, + { + "time":1531310400, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":55.38, + "apparentTemperature":55.38, + "dewPoint":54.82, + "humidity":0.98, + "pressure":1012.16, + "windSpeed":5.57, + "windGust":7.72, + "windBearing":213, + "cloudCover":0.8, + "uvIndex":0, + "visibility":7.37, + "ozone":301.4 + }, + { + "time":1531314000, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0.0012, + "precipProbability":0.01, + "precipType":"rain", + "temperature":54.96, + "apparentTemperature":54.96, + "dewPoint":54.78, + "humidity":0.99, + "pressure":1012.23, + "windSpeed":5.41, + "windGust":7.38, + "windBearing":209, + "cloudCover":0.84, + "uvIndex":0, + "visibility":7.94, + "ozone":301.26 + }, + { + "time":1531317600, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-day", + "precipIntensity":0.0013, + "precipProbability":0.01, + "precipType":"rain", + "temperature":55.05, + "apparentTemperature":55.05, + "dewPoint":54.76, + "humidity":0.99, + "pressure":1012.54, + "windSpeed":5.37, + "windGust":7.13, + "windBearing":202, + "cloudCover":0.9, + "uvIndex":0, + "visibility":9.76, + "ozone":301.19 + }, + { + "time":1531321200, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-day", + "precipIntensity":0.0011, + "precipProbability":0.01, + "precipType":"rain", + "temperature":55.8, + "apparentTemperature":55.8, + "dewPoint":54.77, + "humidity":0.96, + "pressure":1012.74, + "windSpeed":5.33, + "windGust":6.98, + "windBearing":197, + "cloudCover":0.91, + "uvIndex":1, + "visibility":10, + "ozone":301.08 + }, + { + "time":1531324800, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-day", + "precipIntensity":0.0006, + "precipProbability":0.01, + "precipType":"rain", + "temperature":57.44, + "apparentTemperature":57.44, + "dewPoint":54.81, + "humidity":0.91, + "pressure":1012.86, + "windSpeed":5.29, + "windGust":6.86, + "windBearing":198, + "cloudCover":0.84, + "uvIndex":1, + "visibility":10, + "ozone":300.87 + }, + { + "time":1531328400, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":59.43, + "apparentTemperature":59.43, + "dewPoint":54.89, + "humidity":0.85, + "pressure":1012.79, + "windSpeed":5.29, + "windGust":6.8, + "windBearing":203, + "cloudCover":0.67, + "uvIndex":3, + "visibility":10, + "ozone":300.7 + }, + { + "time":1531332000, + "summary":"Partly Cloudy", + "icon":"partly-cloudy-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":62.01, + "apparentTemperature":62.01, + "dewPoint":54.98, + "humidity":0.78, + "pressure":1012.69, + "windSpeed":5.58, + "windGust":6.99, + "windBearing":209, + "cloudCover":0.57, + "uvIndex":5, + "visibility":10, + "ozone":300.5 + }, + { + "time":1531335600, + "summary":"Partly Cloudy", + "icon":"partly-cloudy-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":63.92, + "apparentTemperature":63.92, + "dewPoint":55.06, + "humidity":0.73, + "pressure":1012.52, + "windSpeed":6.24, + "windGust":7.58, + "windBearing":217, + "cloudCover":0.43, + "uvIndex":7, + "visibility":10, + "ozone":300.4 + }, + { + "time":1531339200, + "summary":"Partly Cloudy", + "icon":"partly-cloudy-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":66.26, + "apparentTemperature":66.26, + "dewPoint":55.12, + "humidity":0.67, + "pressure":1012.21, + "windSpeed":7.14, + "windGust":8.39, + "windBearing":225, + "cloudCover":0.29, + "uvIndex":9, + "visibility":10, + "ozone":300.4 + }, + { + "time":1531342800, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":67.86, + "apparentTemperature":67.86, + "dewPoint":55.17, + "humidity":0.64, + "pressure":1011.9, + "windSpeed":7.95, + "windGust":9.19, + "windBearing":231, + "cloudCover":0.22, + "uvIndex":9, + "visibility":9.92, + "ozone":300.43 + }, + { + "time":1531346400, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":68.57, + "apparentTemperature":68.57, + "dewPoint":55.19, + "humidity":0.62, + "pressure":1011.42, + "windSpeed":8.5, + "windGust":10.01, + "windBearing":235, + "cloudCover":0.21, + "uvIndex":7, + "visibility":9.35, + "ozone":300.56 + }, + { + "time":1531350000, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":68.03, + "apparentTemperature":68.03, + "dewPoint":55.18, + "humidity":0.64, + "pressure":1010.93, + "windSpeed":8.86, + "windGust":10.79, + "windBearing":236, + "cloudCover":0.21, + "uvIndex":5, + "visibility":8.9, + "ozone":300.74 + }, + { + "time":1531353600, + "summary":"Clear", + "icon":"clear-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":66.73, + "apparentTemperature":66.73, + "dewPoint":55.2, + "humidity":0.66, + "pressure":1010.56, + "windSpeed":8.95, + "windGust":11.17, + "windBearing":237, + "cloudCover":0.22, + "uvIndex":3, + "visibility":8.97, + "ozone":300.78 + }, + { + "time":1531357200, + "summary":"Partly Cloudy", + "icon":"partly-cloudy-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":64.83, + "apparentTemperature":64.83, + "dewPoint":55.23, + "humidity":0.71, + "pressure":1010.35, + "windSpeed":8.34, + "windGust":10.84, + "windBearing":238, + "cloudCover":0.26, + "uvIndex":1, + "visibility":10, + "ozone":300.63 + }, + { + "time":1531360800, + "summary":"Partly Cloudy", + "icon":"partly-cloudy-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":62.82, + "apparentTemperature":62.82, + "dewPoint":55.28, + "humidity":0.76, + "pressure":1010.4, + "windSpeed":7.51, + "windGust":10.09, + "windBearing":237, + "cloudCover":0.29, + "uvIndex":1, + "visibility":10, + "ozone":300.39 + }, + { + "time":1531364400, + "summary":"Partly Cloudy", + "icon":"partly-cloudy-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":61.04, + "apparentTemperature":61.04, + "dewPoint":55.31, + "humidity":0.81, + "pressure":1010.63, + "windSpeed":6.82, + "windGust":9.42, + "windBearing":236, + "cloudCover":0.33, + "uvIndex":0, + "visibility":10, + "ozone":300.15 + }, + { + "time":1531368000, + "summary":"Partly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":60, + "apparentTemperature":60, + "dewPoint":55.32, + "humidity":0.85, + "pressure":1011.03, + "windSpeed":6.36, + "windGust":8.97, + "windBearing":234, + "cloudCover":0.38, + "uvIndex":0, + "visibility":10, + "ozone":300.11 + }, + { + "time":1531371600, + "summary":"Partly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":59.33, + "apparentTemperature":59.33, + "dewPoint":55.3, + "humidity":0.87, + "pressure":1011.55, + "windSpeed":6.06, + "windGust":8.6, + "windBearing":231, + "cloudCover":0.44, + "uvIndex":0, + "visibility":10, + "ozone":300.18 + }, + { + "time":1531375200, + "summary":"Partly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":58.49, + "apparentTemperature":58.49, + "dewPoint":55.25, + "humidity":0.89, + "pressure":1011.84, + "windSpeed":5.81, + "windGust":8.3, + "windBearing":229, + "cloudCover":0.47, + "uvIndex":0, + "visibility":10, + "ozone":300.14 + }, + { + "time":1531378800, + "summary":"Partly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":57.95, + "apparentTemperature":57.95, + "dewPoint":55.14, + "humidity":0.9, + "pressure":1011.98, + "windSpeed":5.67, + "windGust":8.14, + "windBearing":231, + "cloudCover":0.53, + "uvIndex":0, + "visibility":10, + "ozone":300 + }, + { + "time":1531382400, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":57.57, + "apparentTemperature":57.57, + "dewPoint":55, + "humidity":0.91, + "pressure":1011.97, + "windSpeed":5.52, + "windGust":8.05, + "windBearing":231, + "cloudCover":0.6, + "uvIndex":0, + "visibility":10, + "ozone":299.83 + }, + { + "time":1531386000, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":57.23, + "apparentTemperature":57.23, + "dewPoint":54.87, + "humidity":0.92, + "pressure":1012.06, + "windSpeed":5.43, + "windGust":7.93, + "windBearing":227, + "cloudCover":0.65, + "uvIndex":0, + "visibility":10, + "ozone":299.52 + }, + { + "time":1531389600, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":56.85, + "apparentTemperature":56.85, + "dewPoint":54.77, + "humidity":0.93, + "pressure":1012.11, + "windSpeed":5.32, + "windGust":7.74, + "windBearing":218, + "cloudCover":0.69, + "uvIndex":0, + "visibility":10, + "ozone":298.81 + }, + { + "time":1531393200, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":56.37, + "apparentTemperature":56.37, + "dewPoint":54.67, + "humidity":0.94, + "pressure":1012.12, + "windSpeed":4.67, + "windGust":7.52, + "windBearing":228, + "cloudCover":0.75, + "uvIndex":0, + "visibility":10, + "ozone":298.05 + }, + { + "time":1531396800, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":56.08, + "apparentTemperature":56.08, + "dewPoint":54.59, + "humidity":0.95, + "pressure":1012.25, + "windSpeed":4.66, + "windGust":7.3, + "windBearing":226, + "cloudCover":0.78, + "uvIndex":0, + "visibility":10, + "ozone":297.47 + }, + { + "time":1531400400, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-night", + "precipIntensity":0, + "precipProbability":0, + "temperature":55.94, + "apparentTemperature":55.94, + "dewPoint":54.55, + "humidity":0.95, + "pressure":1012.44, + "windSpeed":4.09, + "windGust":7.06, + "windBearing":228, + "cloudCover":0.82, + "uvIndex":0, + "visibility":10, + "ozone":297.48 + }, + { + "time":1531404000, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":56.13, + "apparentTemperature":56.13, + "dewPoint":54.52, + "humidity":0.94, + "pressure":1012.88, + "windSpeed":4.21, + "windGust":6.82, + "windBearing":220, + "cloudCover":0.86, + "uvIndex":0, + "visibility":10, + "ozone":297.86 + }, + { + "time":1531407600, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":56.97, + "apparentTemperature":56.97, + "dewPoint":54.53, + "humidity":0.92, + "pressure":1013.28, + "windSpeed":4.11, + "windGust":6.63, + "windBearing":227, + "cloudCover":0.84, + "uvIndex":1, + "visibility":10, + "ozone":298.32 + }, + { + "time":1531411200, + "summary":"Mostly Cloudy", + "icon":"partly-cloudy-day", + "precipIntensity":0, + "precipProbability":0, + "temperature":58.79, + "apparentTemperature":58.79, + "dewPoint":54.58, + "humidity":0.86, + "pressure":1013.74, + "windSpeed":4.41, + "windGust":6.4, + "windBearing":229, + "cloudCover":0.72, + "uvIndex":1, + "visibility":10, + "ozone":298.79 + } + ] + }, + "daily":{ + "summary":"No precipitation throughout the week, with high temperatures falling to 68°F on Thursday.", + "icon":"clear-day", + "data":[ + { + "time":1531206000, + "summary":"Partly cloudy overnight.", + "icon":"partly-cloudy-night", + "sunriseTime":1531227460, + "sunsetTime":1531280088, + "moonPhase":0.91, + "precipIntensity":0, + "precipIntensityMax":0, + "precipProbability":0, + "temperatureHigh":73.88, + "temperatureHighTime":1531256400, + "temperatureLow":54.96, + "temperatureLowTime":1531314000, + "apparentTemperatureHigh":73.88, + "apparentTemperatureHighTime":1531256400, + "apparentTemperatureLow":54.96, + "apparentTemperatureLowTime":1531314000, + "dewPoint":51.8, + "humidity":0.62, + "pressure":1015.37, + "windSpeed":6.26, + "windGust":19.67, + "windGustTime":1531263600, + "windBearing":254, + "cloudCover":0.06, + "uvIndex":11, + "uvIndexTime":1531252800, + "visibility":10, + "ozone":307.46, + "temperatureMin":59.24, + "temperatureMinTime":1531288800, + "temperatureMax":73.88, + "temperatureMaxTime":1531256400, + "apparentTemperatureMin":59.24, + "apparentTemperatureMinTime":1531288800, + "apparentTemperatureMax":73.88, + "apparentTemperatureMaxTime":1531256400 + }, + { + "time":1531292400, + "summary":"Partly cloudy throughout the day.", + "icon":"partly-cloudy-day", + "sunriseTime":1531313899, + "sunsetTime":1531366465, + "moonPhase":0.95, + "precipIntensity":0.0004, + "precipIntensityMax":0.0013, + "precipIntensityMaxTime":1531317600, + "precipProbability":0.01, + "precipType":"rain", + "temperatureHigh":68.57, + "temperatureHighTime":1531346400, + "temperatureLow":55.94, + "temperatureLowTime":1531400400, + "apparentTemperatureHigh":68.57, + "apparentTemperatureHighTime":1531346400, + "apparentTemperatureLow":55.94, + "apparentTemperatureLowTime":1531400400, + "dewPoint":55.07, + "humidity":0.83, + "pressure":1011.98, + "windSpeed":6.36, + "windGust":11.17, + "windGustTime":1531353600, + "windBearing":225, + "cloudCover":0.51, + "uvIndex":9, + "uvIndexTime":1531339200, + "visibility":10, + "ozone":300.94, + "temperatureMin":54.96, + "temperatureMinTime":1531314000, + "temperatureMax":68.57, + "temperatureMaxTime":1531346400, + "apparentTemperatureMin":54.96, + "apparentTemperatureMinTime":1531314000, + "apparentTemperatureMax":68.57, + "apparentTemperatureMaxTime":1531346400 + }, + { + "time":1531378800, + "summary":"Mostly cloudy until afternoon.", + "icon":"partly-cloudy-day", + "sunriseTime":1531400339, + "sunsetTime":1531452841, + "moonPhase":0.99, + "precipIntensity":0.0002, + "precipIntensityMax":0.0003, + "precipIntensityMaxTime":1531389600, + "precipProbability":0.08, + "precipType":"rain", + "temperatureHigh":68.09, + "temperatureHighTime":1531432800, + "temperatureLow":56.86, + "temperatureLowTime":1531483200, + "apparentTemperatureHigh":68.09, + "apparentTemperatureHighTime":1531432800, + "apparentTemperatureLow":56.86, + "apparentTemperatureLowTime":1531483200, + "dewPoint":54.76, + "humidity":0.81, + "pressure":1013.5, + "windSpeed":6.26, + "windGust":13.38, + "windGustTime":1531440000, + "windBearing":239, + "cloudCover":0.46, + "uvIndex":10, + "uvIndexTime":1531425600, + "visibility":10, + "ozone":298.73, + "temperatureMin":55.94, + "temperatureMinTime":1531400400, + "temperatureMax":68.09, + "temperatureMaxTime":1531432800, + "apparentTemperatureMin":55.94, + "apparentTemperatureMinTime":1531400400, + "apparentTemperatureMax":68.09, + "apparentTemperatureMaxTime":1531432800 + }, + { + "time":1531465200, + "summary":"Mostly cloudy throughout the day.", + "icon":"partly-cloudy-day", + "sunriseTime":1531486779, + "sunsetTime":1531539214, + "moonPhase":0.03, + "precipIntensity":0.0001, + "precipIntensityMax":0.0004, + "precipIntensityMaxTime":1531494000, + "precipProbability":0.04, + "precipType":"rain", + "temperatureHigh":68.29, + "temperatureHighTime":1531530000, + "temperatureLow":54.97, + "temperatureLowTime":1531569600, + "apparentTemperatureHigh":68.29, + "apparentTemperatureHighTime":1531530000, + "apparentTemperatureLow":54.97, + "apparentTemperatureLowTime":1531569600, + "dewPoint":55.01, + "humidity":0.79, + "pressure":1016.15, + "windSpeed":5.79, + "windGust":12.43, + "windGustTime":1531526400, + "windBearing":246, + "cloudCover":0.59, + "uvIndex":9, + "uvIndexTime":1531512000, + "visibility":10, + "ozone":291.77, + "temperatureMin":56.86, + "temperatureMinTime":1531483200, + "temperatureMax":68.29, + "temperatureMaxTime":1531530000, + "apparentTemperatureMin":56.86, + "apparentTemperatureMinTime":1531483200, + "apparentTemperatureMax":68.29, + "apparentTemperatureMaxTime":1531530000 + }, + { + "time":1531551600, + "summary":"Mostly cloudy until afternoon.", + "icon":"partly-cloudy-day", + "sunriseTime":1531573221, + "sunsetTime":1531625586, + "moonPhase":0.06, + "precipIntensity":0.0002, + "precipIntensityMax":0.0004, + "precipIntensityMaxTime":1531634400, + "precipProbability":0.01, + "precipType":"rain", + "temperatureHigh":70.12, + "temperatureHighTime":1531605600, + "temperatureLow":55.96, + "temperatureLowTime":1531656000, + "apparentTemperatureHigh":70.12, + "apparentTemperatureHighTime":1531605600, + "apparentTemperatureLow":55.96, + "apparentTemperatureLowTime":1531656000, + "dewPoint":54.38, + "humidity":0.78, + "pressure":1014.47, + "windSpeed":5.3, + "windGust":11.83, + "windGustTime":1531612800, + "windBearing":249, + "cloudCover":0.45, + "uvIndex":11, + "uvIndexTime":1531602000, + "visibility":10, + "ozone":288.79, + "temperatureMin":54.97, + "temperatureMinTime":1531569600, + "temperatureMax":70.12, + "temperatureMaxTime":1531605600, + "apparentTemperatureMin":54.97, + "apparentTemperatureMinTime":1531569600, + "apparentTemperatureMax":70.12, + "apparentTemperatureMaxTime":1531605600 + }, + { + "time":1531638000, + "summary":"Partly cloudy overnight.", + "icon":"partly-cloudy-night", + "sunriseTime":1531659663, + "sunsetTime":1531711955, + "moonPhase":0.1, + "precipIntensity":0, + "precipIntensityMax":0, + "precipProbability":0, + "temperatureHigh":71.35, + "temperatureHighTime":1531692000, + "temperatureLow":56.29, + "temperatureLowTime":1531742400, + "apparentTemperatureHigh":71.35, + "apparentTemperatureHighTime":1531692000, + "apparentTemperatureLow":56.29, + "apparentTemperatureLowTime":1531742400, + "dewPoint":55.37, + "humidity":0.79, + "pressure":1012.27, + "windSpeed":5.17, + "windGust":10.62, + "windGustTime":1531695600, + "windBearing":238, + "cloudCover":0.1, + "uvIndex":11, + "uvIndexTime":1531684800, + "visibility":10, + "ozone":285.99, + "temperatureMin":55.96, + "temperatureMinTime":1531656000, + "temperatureMax":71.35, + "temperatureMaxTime":1531692000, + "apparentTemperatureMin":55.96, + "apparentTemperatureMinTime":1531656000, + "apparentTemperatureMax":71.35, + "apparentTemperatureMaxTime":1531692000 + }, + { + "time":1531724400, + "summary":"Mostly cloudy throughout the day.", + "icon":"partly-cloudy-day", + "sunriseTime":1531746107, + "sunsetTime":1531798324, + "moonPhase":0.14, + "precipIntensity":0, + "precipIntensityMax":0, + "precipProbability":0, + "temperatureHigh":71.6, + "temperatureHighTime":1531778400, + "temperatureLow":58.02, + "temperatureLowTime":1531828800, + "apparentTemperatureHigh":71.6, + "apparentTemperatureHighTime":1531778400, + "apparentTemperatureLow":58.02, + "apparentTemperatureLowTime":1531828800, + "dewPoint":54.98, + "humidity":0.76, + "pressure":1012.5, + "windSpeed":5.46, + "windGust":11.95, + "windGustTime":1531782000, + "windBearing":232, + "cloudCover":0.6, + "uvIndex":7, + "uvIndexTime":1531771200, + "visibility":10, + "ozone":291.72, + "temperatureMin":56.29, + "temperatureMinTime":1531742400, + "temperatureMax":71.6, + "temperatureMaxTime":1531778400, + "apparentTemperatureMin":56.29, + "apparentTemperatureMinTime":1531742400, + "apparentTemperatureMax":71.6, + "apparentTemperatureMaxTime":1531778400 + }, + { + "time":1531810800, + "summary":"Mostly cloudy throughout the day.", + "icon":"partly-cloudy-day", + "sunriseTime":1531832551, + "sunsetTime":1531884690, + "moonPhase":0.18, + "precipIntensity":0.0002, + "precipIntensityMax":0.0008, + "precipIntensityMaxTime":1531836000, + "precipProbability":0.04, + "precipType":"rain", + "temperatureHigh":71.85, + "temperatureHighTime":1531864800, + "temperatureLow":58.53, + "temperatureLowTime":1531918800, + "apparentTemperatureHigh":71.85, + "apparentTemperatureHighTime":1531864800, + "apparentTemperatureLow":58.53, + "apparentTemperatureLowTime":1531918800, + "dewPoint":54.7, + "humidity":0.73, + "pressure":1014.04, + "windSpeed":5.71, + "windGust":11.94, + "windGustTime":1531868400, + "windBearing":242, + "cloudCover":0.5, + "uvIndex":7, + "uvIndexTime":1531854000, + "visibility":10, + "ozone":293.92, + "temperatureMin":58.02, + "temperatureMinTime":1531828800, + "temperatureMax":71.85, + "temperatureMaxTime":1531864800, + "apparentTemperatureMin":58.02, + "apparentTemperatureMinTime":1531828800, + "apparentTemperatureMax":71.85, + "apparentTemperatureMaxTime":1531864800 + } + ] + }, + "flags":{ + "sources":[ + "nearest-precip", + "nwspa", + "cmc", + "gfs", + "hrrr", + "icon", + "isd", + "madis", + "nam", + "sref", + "darksky" + ], + "nearest-station":1.839, + "units":"us" + }, + "offset":-7 +} \ No newline at end of file diff --git a/JavaScript/weather-api-resolver/index.js b/JavaScript/weather-api-resolver/index.js new file mode 100644 index 0000000..e217661 --- /dev/null +++ b/JavaScript/weather-api-resolver/index.js @@ -0,0 +1,59 @@ +const express = require('express'); +const request = require('snekfetch'); +const bodyParser = require('body-parser'); +const fs = require('fs'); + +let port = 8080; +let app = express(); + +app.use(bodyParser.json()); +app.use(bodyParser.urlencoded({ extended: true })); +app.use(express.static('./client')); + +let apiKey = '8787dcc902ae16212b6325ad5628b4c1' +let lat; +let long; +let units = 'auto'; + +app.get('/', function (req, res) { + res.sendFile( __dirname + '/client'); +}); + +app.get('/weather', async function (req, res) { + console.log('New Request from ' + req.connection.remoteAddress); + let ext = ['°C', '°F']; + let chos; + lat = req.query.lat; + long = req.query.long; + if (!req.query.celsius) { + units = 'si'; + chos = 0; + } else { + units = 'us'; + chos = 1; + } + + let weather = await startreq(); + + if (weather.toString() != -1) { + res.end(weather.toString() + ext[chos]); + } else { + res.end('Invalid Coordinates'); + } + +}); + +async function startreq() { + try { + let req = request.get(`https://api.darksky.net/forecast/${apiKey}/${lat},${long}`) + req.query('units', units) + let res = await req.send(); + + return res.body.currently.summary + ', ' + res.body.currently.temperature; + } catch (e) { + return -1; + } +} + +let server = app.listen(port); +console.log(`App listening at ${port}`); diff --git a/JavaScript/weather-api-resolver/package-lock.json b/JavaScript/weather-api-resolver/package-lock.json new file mode 100644 index 0000000..a13087b --- /dev/null +++ b/JavaScript/weather-api-resolver/package-lock.json @@ -0,0 +1,433 @@ +{ + "name": "weather-api-resolver", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "accepts": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "requires": { + "mime-types": "2.1.18", + "negotiator": "0.6.1" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "body-parser": { + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", + "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "1.0.4", + "debug": "2.6.9", + "depd": "1.1.2", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", + "on-finished": "2.3.0", + "qs": "6.5.2", + "raw-body": "2.3.3", + "type-is": "1.6.16" + }, + "dependencies": { + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + } + } + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "express": { + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", + "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", + "requires": { + "accepts": "1.3.5", + "array-flatten": "1.1.1", + "body-parser": "1.18.2", + "content-disposition": "0.5.2", + "content-type": "1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "1.1.2", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.1.1", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "2.0.3", + "qs": "6.5.1", + "range-parser": "1.2.0", + "safe-buffer": "5.1.1", + "send": "0.16.2", + "serve-static": "1.13.2", + "setprototypeof": "1.1.0", + "statuses": "1.4.0", + "type-is": "1.6.16", + "utils-merge": "1.0.1", + "vary": "1.1.2" + }, + "dependencies": { + "body-parser": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", + "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "1.0.4", + "debug": "2.6.9", + "depd": "1.1.2", + "http-errors": "1.6.3", + "iconv-lite": "0.4.19", + "on-finished": "2.3.0", + "qs": "6.5.1", + "raw-body": "2.3.2", + "type-is": "1.6.16" + } + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + }, + "raw-body": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "unpipe": "1.0.0" + }, + "dependencies": { + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": "1.4.0" + } + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" + } + } + } + } + }, + "finalhandler": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "requires": { + "debug": "2.6.9", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "statuses": "1.4.0", + "unpipe": "1.0.0" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "fs": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", + "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "requires": { + "depd": "1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": "1.4.0" + } + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "requires": { + "safer-buffer": "2.1.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ipaddr.js": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz", + "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=" + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + }, + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "requires": { + "mime-db": "1.33.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "proxy-addr": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz", + "integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==", + "requires": { + "forwarded": "0.1.2", + "ipaddr.js": "1.6.0" + } + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + }, + "raw-body": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", + "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", + "unpipe": "1.0.0" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "send": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "requires": { + "debug": "2.6.9", + "depd": "1.1.2", + "destroy": "1.0.4", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "fresh": "0.5.2", + "http-errors": "1.6.3", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.4.0" + } + }, + "serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "requires": { + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "parseurl": "1.3.2", + "send": "0.16.2" + } + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + }, + "snekfetch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-4.0.4.tgz", + "integrity": "sha512-dyycG9fvwtSJqKPfMVOpXt+60qvMGe7vWLwOJDiSJaiAx+hs2EnFChG2bXCWn7ulz+zGzrHdN9/yeEb0YqEPww==" + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + }, + "type-is": { + "version": "1.6.16", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", + "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "2.1.18" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + } + } +} diff --git a/JavaScript/weather-api-resolver/package.json b/JavaScript/weather-api-resolver/package.json new file mode 100644 index 0000000..b1c8bb3 --- /dev/null +++ b/JavaScript/weather-api-resolver/package.json @@ -0,0 +1,17 @@ +{ + "name": "weather-api-resolver", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "Ben (plane000)", + "license": "MIT", + "dependencies": { + "body-parser": "^1.18.3", + "express": "^4.16.3", + "fs": "0.0.1-security", + "snekfetch": "^4.0.4" + } +} diff --git a/JavaScript/weather-api-resolver/resources/images/weather/clear-day.png b/JavaScript/weather-api-resolver/resources/images/weather/clear-day.png new file mode 100644 index 0000000..ffd166e Binary files /dev/null and b/JavaScript/weather-api-resolver/resources/images/weather/clear-day.png differ diff --git a/JavaScript/weather-api-resolver/resources/images/weather/clear-night.png b/JavaScript/weather-api-resolver/resources/images/weather/clear-night.png new file mode 100644 index 0000000..16813d0 Binary files /dev/null and b/JavaScript/weather-api-resolver/resources/images/weather/clear-night.png differ diff --git a/JavaScript/weather-api-resolver/resources/images/weather/cloudy.png b/JavaScript/weather-api-resolver/resources/images/weather/cloudy.png new file mode 100644 index 0000000..0365126 Binary files /dev/null and b/JavaScript/weather-api-resolver/resources/images/weather/cloudy.png differ diff --git a/JavaScript/weather-api-resolver/resources/images/weather/fog.png b/JavaScript/weather-api-resolver/resources/images/weather/fog.png new file mode 100644 index 0000000..dcd443f Binary files /dev/null and b/JavaScript/weather-api-resolver/resources/images/weather/fog.png differ diff --git a/JavaScript/weather-api-resolver/resources/images/weather/partialy-cloudy-day.png b/JavaScript/weather-api-resolver/resources/images/weather/partialy-cloudy-day.png new file mode 100644 index 0000000..13fbbe9 Binary files /dev/null and b/JavaScript/weather-api-resolver/resources/images/weather/partialy-cloudy-day.png differ diff --git a/JavaScript/weather-api-resolver/resources/images/weather/partialy-cloudy-night.png b/JavaScript/weather-api-resolver/resources/images/weather/partialy-cloudy-night.png new file mode 100644 index 0000000..37a82d0 Binary files /dev/null and b/JavaScript/weather-api-resolver/resources/images/weather/partialy-cloudy-night.png differ diff --git a/JavaScript/weather-api-resolver/resources/images/weather/rain.png b/JavaScript/weather-api-resolver/resources/images/weather/rain.png new file mode 100644 index 0000000..95ce09d Binary files /dev/null and b/JavaScript/weather-api-resolver/resources/images/weather/rain.png differ diff --git a/JavaScript/weather-api-resolver/resources/images/weather/sleet.png b/JavaScript/weather-api-resolver/resources/images/weather/sleet.png new file mode 100644 index 0000000..46784b7 Binary files /dev/null and b/JavaScript/weather-api-resolver/resources/images/weather/sleet.png differ diff --git a/JavaScript/weather-api-resolver/resources/images/weather/snow.png b/JavaScript/weather-api-resolver/resources/images/weather/snow.png new file mode 100644 index 0000000..b94c41f Binary files /dev/null and b/JavaScript/weather-api-resolver/resources/images/weather/snow.png differ diff --git a/JavaScript/weather-api-resolver/resources/images/weather/wind.png b/JavaScript/weather-api-resolver/resources/images/weather/wind.png new file mode 100644 index 0000000..aa063ad Binary files /dev/null and b/JavaScript/weather-api-resolver/resources/images/weather/wind.png differ