Skip to content
Open
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
# Logs
logs
*.log
Expand Down Expand Up @@ -136,4 +137,4 @@ dist
.pnp.*

# Add .vscode folder
.vscode/
.vscode/
Binary file added webroot/images/.DS_Store
Binary file not shown.
Binary file added webroot/images/skeletons/.DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions webroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@
<option value="iataCode">IATA Code</option>
<option value="icaoCode">ICAO Code</option>
</select>
<select name="mainloc-types" id="tempunit-dropdown" class="dropdown">
<option value="e">Imperial</option>
<option value="m">Metric</option>
</select>
<div class="location-warning" style="display: none">
ERROR: Enter in a value for the location or click automatic.
</div>
Expand Down
8 changes: 4 additions & 4 deletions webroot/js/config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
var api_key = "e1f10a1e78da46f5b10a1e78da96f525";
var map_key = "pk.eyJ1Ijoid2VhdGhlciIsImEiOiJjaW4wbzllcjkwYWtrd2JsdWl3dG1hZjZ1In0.AdcjoWQiVfvjHfOB0nsyeQ";
var api_key = "YOUR_API_KEY";
var map_key = "YOUR_API_KEY";

var apperanceSettings = {
providerName: "Mist Digital Cable",
skipSettings: false, //set to true for no settings panel on startup
startupTime: 5000, //How long you want to wait for everything to load
//we recommend not setting startupTime to anything less than like 3000 (4 seconds) as it takes time to download info off the internet.
enableCrawl: true, //set to fale if you don't want any ad crawl
adMessage: ["If you are interested in TWC, EAS, or anything weather/tech related, join Mist Weather Media! Visit mistwx.com/discord right now!", "Want to watch Weatherscan and more from around the US? Visit live.weatherscan.net and search through the guide today!", "If a tornado warning is issued will you get the call? Sign up now to recieve a phone call warning when severe weather is headed your way. Visit weather.com/notify to learn more.", "Now Available! Get picture perfect weather with The Weather Channel HD.",],
enableCrawl: true, //set to false if you don't want any ad crawl
adMessage: ["If you are interested in TWC, EAS, or anything weather/tech related, join Mist Weather Media! Visit mistwx.com/discord right now!", "Want to watch Weatherscan and more from around the globe? Visit live.mistweather.com and search through the guide today!", "If a tornado warning is issued will you get the call? Sign up now to recieve a phone call warning when severe weather is headed your way. Visit weather.com/notify to learn more.", "Now Available! Get picture perfect weather with The Weather Channel HD.",],
aspectRatio: 4/3, //3/2 or 4/3
crawlInterval: 48000,
version: "1.22",
Expand Down
40 changes: 20 additions & 20 deletions webroot/js/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ var weatherData = {
function grabData() {
//console.log("grabbed data")
function grabCurrentConditions() {
var url = "https://api.weather.com/v3/wx/observations/current?geocode=" + locationConfig.mainCity.lat + "," + locationConfig.mainCity.lon + "&units=e&language=en-US&format=json&apiKey=" + api_key
var url = "https://api.weather.com/v3/wx/observations/current?geocode=" + locationConfig.mainCity.lat + "," + locationConfig.mainCity.lon + "&units=" + locationConfig.units +"&language=en-US&format=json&apiKey=" + api_key
$.getJSON(url, function(data) {
try {
weatherData.currentConditions.cityname = locationConfig.mainCity.displayname
weatherData.currentConditions.cond = data.wxPhraseLong
weatherData.currentConditions.gusts = ((data.windGust != null || data.windGust != undefined) ? data.windGust + " mph" : "None")
weatherData.currentConditions.gusts = ((data.windGust != null || data.windGust != undefined) ? data.windGust + ((locationConfig.units == "e") ? " mph" : "km/h") : "None")
weatherData.currentConditions.humidity = data.relativeHumidity + "%"
weatherData.currentConditions.icon = data.iconCode
weatherData.currentConditions.pressure = data.pressureAltimeter.toFixed(2)
Expand Down Expand Up @@ -234,7 +234,7 @@ function grabData() {
for (var li = 0; li < locationConfig.eightCities.citiesAmount; li++) {
url += locationConfig.eightCities.cities[li].lat + "," + locationConfig.eightCities.cities[li].lon + ";"
}
url += "&language=en-US&units=e&format=json&apiKey=" + api_key
url += "&language=en-US&units=" + locationConfig.units + "&format=json&apiKey=" + api_key
$.getJSON(url, function(data) {
data.forEach((ajaxedLoc, i) => {
var nearbyCitiesObj = {noReport:false,cityname:"", temp:"", icon:"", wind:"", windspeed:""};
Expand Down Expand Up @@ -286,7 +286,7 @@ function grabData() {
}
grabNearbyConditions();
function grabDayDesc() {
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.mainCity.lat + "," + locationConfig.mainCity.lon + "&format=json&units=e&language=en-US&apiKey=" + api_key
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.mainCity.lat + "," + locationConfig.mainCity.lon + "&format=json&units=" + locationConfig.units + "&language=en-US&apiKey=" + api_key
$.getJSON(url, function(data) {
var ii = 0
try {
Expand Down Expand Up @@ -324,7 +324,7 @@ function grabData() {
}
grabDayDesc()
function grabExtended() {
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.mainCity.lat + "," + locationConfig.mainCity.lon + "&format=json&units=e&language=en-US&apiKey=" + api_key
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.mainCity.lat + "," + locationConfig.mainCity.lon + "&format=json&units=" + locationConfig.units + "&language=en-US&apiKey=" + api_key
$.getJSON(url, function(data) {
var daysDivs = ['one', "two", "three", "four", "five"]
try {
Expand Down Expand Up @@ -383,7 +383,7 @@ function grabData() {
}
grabExtended()
function grabAlmanac() {
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.mainCity.lat + "," + locationConfig.mainCity.lon + "&format=json&units=e&language=en-US&apiKey=" + api_key
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.mainCity.lat + "," + locationConfig.mainCity.lon + "&format=json&units=" + locationConfig.units + "&language=en-US&apiKey=" + api_key
$.getJSON(url, function(data) {
var ii = 0
if (data.daypart[0].daypartName[0] == null) {
Expand Down Expand Up @@ -592,7 +592,7 @@ function grabAirportData() {
for (var li = 0; li < locationConfig.airport.airportsAmount; li++) {
url += locationConfig.airport.airports[li].lat + "," + locationConfig.airport.airports[li].lon + ";"
}
url += "&language=en-US&units=e&format=json&apiKey=" + api_key
url += "&language=en-US&units=" + locationConfig.units + "&format=json&apiKey=" + api_key
$.getJSON(url, function(data) {
data.forEach((ajaxedLoc, i) => {
var airportsObj = {noReport:false,airportName:"",iataCode:"",temp:"",icon:"",condition:"",humidity:"",pressure:"",wind:"",gusts:"",windspeed:"",delay:""}
Expand All @@ -603,7 +603,7 @@ function grabAirportData() {
airportsObj.iataCode = locationConfig.airport.airports[i].iataCode
airportsObj.condition = ajaxedLoc["v3-wx-observations-current"].wxPhraseLong
airportsObj.icon = ajaxedLoc["v3-wx-observations-current"].iconCode
airportsObj.gusts = ((ajaxedLoc["v3-wx-observations-current"].windGust != null || ajaxedLoc["v3-wx-observations-current"].windGust != undefined) ? ajaxedLoc["v3-wx-observations-current"].windGust + " mph" : "None")
airportsObj.gusts = ((ajaxedLoc["v3-wx-observations-current"].windGust != null || ajaxedLoc["v3-wx-observations-current"].windGust != undefined) ? ajaxedLoc["v3-wx-observations-current"].windGust + ((locationConfig.units == "e") ? " mph" : "km/h") : "None")
airportsObj.humidity = ajaxedLoc["v3-wx-observations-current"].relativeHumidity + "%"
airportsObj.pressure = ajaxedLoc["v3-wx-observations-current"].pressureAltimeter
airportsObj.temp = ajaxedLoc["v3-wx-observations-current"].temperature
Expand Down Expand Up @@ -675,7 +675,7 @@ function grabAirportData() {
for (var li = 0; li < weatherData.nationalAirports.airports.length; li++) {
url += weatherData.nationalAirports.airports[li].lat + "," + weatherData.nationalAirports.airports[li].lon + ";"
}
url += "&language=en-US&units=e&format=json&apiKey=" + api_key
url += "&language=en-US&units=" + locationConfig.units + "&format=json&apiKey=" + api_key
$.getJSON(url, function(data) {
data.forEach((ajaxedLoc, i) => {
weatherData.nationalAirports.airports[i].delay = ""
Expand Down Expand Up @@ -725,12 +725,12 @@ function grabAirportData() {
function grabSpanishData() {
//console.log("grabbed data")
function grabESCurrentConditions() {
var url = "https://api.weather.com/v3/wx/observations/current?geocode=" + locationConfig.mainCity.lat + "," + locationConfig.mainCity.lon + "&units=e&language=es-US&format=json&apiKey=" + api_key
var url = "https://api.weather.com/v3/wx/observations/current?geocode=" + locationConfig.mainCity.lat + "," + locationConfig.mainCity.lon + "&units=" + locationConfig.units + "&language=es-US&format=json&apiKey=" + api_key
$.getJSON(url, function(data) {
try {
weatherData.spanish.currentConditions.cityname = locationConfig.mainCity.displayname
weatherData.spanish.currentConditions.cond = data.wxPhraseLong
weatherData.spanish.currentConditions.gusts = ((data.windGust != null || data.windGust != undefined) ? data.windGust + " mph" : "No")
weatherData.spanish.currentConditions.gusts = ((data.windGust != null || data.windGust != undefined) ? data.windGust + ((locationConfig.units == "e") ? " mph" : "km/h") : "No")
weatherData.spanish.currentConditions.humidity = data.relativeHumidity + "%"
weatherData.spanish.currentConditions.icon = data.iconCode
weatherData.spanish.currentConditions.pressure = data.pressureAltimeter.toFixed(2)
Expand Down Expand Up @@ -776,7 +776,7 @@ function grabSpanishData() {
for (var li = 0; li < locationConfig.eightCities.citiesAmount; li++) {
url += locationConfig.eightCities.cities[li].lat + "," + locationConfig.eightCities.cities[li].lon + ";"
}
url += "&language=es-US&units=e&format=json&apiKey=" + api_key
url += "&language=es-US&units=" + locationConfig.units + "&format=json&apiKey=" + api_key
$.getJSON(url, function(data) {
data.forEach((ajaxedLoc, i) => {
var nearbyCitiesObj = {noReport:false,cityname:"", temp:"", icon:"", wind:"", windspeed:""};
Expand Down Expand Up @@ -828,7 +828,7 @@ function grabSpanishData() {
}
grabESNearbyConditions();
function grabESExtended() {
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.mainCity.lat + "," + locationConfig.mainCity.lon + "&format=json&units=e&language=es-US&apiKey=" + api_key
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.mainCity.lat + "," + locationConfig.mainCity.lon + "&format=json&units=" + locationConfig.units + "&language=es-US&apiKey=" + api_key
//console.log(url)
$.getJSON(url, function(data) {
var daysDivs = ['one', "two", "three", "four", "five"]
Expand Down Expand Up @@ -888,7 +888,7 @@ function grabSpanishData() {
}
grabESExtended()
function grabESAlmanac() {
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.mainCity.lat + "," + locationConfig.mainCity.lon + "&format=json&units=e&language=es-US&apiKey=" + api_key
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.mainCity.lat + "," + locationConfig.mainCity.lon + "&format=json&units=" + locationConfig.units + "&language=es-US&apiKey=" + api_key
$.getJSON(url, function(data) {
var ii = 0
if (data.daypart[0].daypartName[0] == null) {
Expand Down Expand Up @@ -975,7 +975,7 @@ function grabSpanishData() {
}
function grabGolfData() {
function grabCoursesData(ci) {
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.golf.courses[ci].lat + "," + locationConfig.golf.courses[ci].lon + "&format=json&units=e&language=en-US&apiKey=" + api_key
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.golf.courses[ci].lat + "," + locationConfig.golf.courses[ci].lon + "&format=json&units=" + locationConfig.units + "&language=en-US&apiKey=" + api_key
$.getJSON(url, function(data) {
try {
weatherData.golf.courseForecast[ci].cityname = locationConfig.golf.courses[ci].displayname
Expand Down Expand Up @@ -1036,7 +1036,7 @@ function grabGolfData() {
grabCoursesData(i)
}
function grabResortsData(ri) {
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.golf.resorts[ri].lat + "," + locationConfig.golf.resorts[ri].lon + "&format=json&units=e&language=en-US&apiKey=" + api_key
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.golf.resorts[ri].lat + "," + locationConfig.golf.resorts[ri].lon + "&format=json&units=" + locationConfig.units + "&language=en-US&apiKey=" + api_key
$.getJSON(url, function(data) {
try {
weatherData.golf.resortForecast[ri].cityname = locationConfig.golf.resorts[ri].displayname
Expand Down Expand Up @@ -1168,12 +1168,12 @@ function grabHealthData() {
}
function grabExtraData() {
function grabEXCurrentConditions() {
var url = "https://api.weather.com/v3/wx/observations/current?geocode=" + locationConfig.extraCity.lat + "," + locationConfig.extraCity.lon + "&units=e&language=en-US&format=json&apiKey=" + api_key
var url = "https://api.weather.com/v3/wx/observations/current?geocode=" + locationConfig.extraCity.lat + "," + locationConfig.extraCity.lon + "&units=" + locationConfig.units + "&language=en-US&format=json&apiKey=" + api_key
$.getJSON(url, function(data) {
try {
weatherData.extraLocal.currentConditions.cityname = locationConfig.extraCity.displayname
weatherData.extraLocal.currentConditions.cond = data.wxPhraseLong
weatherData.extraLocal.currentConditions.gusts = ((data.windGust != null || data.windGust != undefined) ? data.windGust + " mph" : "None")
weatherData.extraLocal.currentConditions.gusts = ((data.windGust != null || data.windGust != undefined) ? data.windGust + ((locationConfig.units == "e") ? " mph" : "km/h") : "None")
weatherData.extraLocal.currentConditions.humidity = data.relativeHumidity + "%"
weatherData.extraLocal.currentConditions.icon = data.iconCode
weatherData.extraLocal.currentConditions.pressure = data.pressureAltimeter.toFixed(2)
Expand Down Expand Up @@ -1208,7 +1208,7 @@ function grabExtraData() {
}
grabEXCurrentConditions();
function grabEXDayDesc() {
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.extraCity.lat + "," + locationConfig.extraCity.lon + "&format=json&units=e&language=en-US&apiKey=" + api_key
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.extraCity.lat + "," + locationConfig.extraCity.lon + "&format=json&units=" + locationConfig.units + "&language=en-US&apiKey=" + api_key
$.getJSON(url, function(data) {
var ii = 0
try {
Expand Down Expand Up @@ -1240,7 +1240,7 @@ function grabExtraData() {
}
grabEXDayDesc()
function grabEXExtended() {
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.extraCity.lat + "," + locationConfig.extraCity.lon + "&format=json&units=e&language=en-US&apiKey=" + api_key
var url = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=" + locationConfig.extraCity.lat + "," + locationConfig.extraCity.lon + "&format=json&units=" + locationConfig.units + "&language=en-US&apiKey=" + api_key
$.getJSON(url, function(data) {
var daysDivs = ['one', "two", "three", "four", "five"]
try {
Expand Down
9 changes: 7 additions & 2 deletions webroot/js/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ var locationSettings = {
val:"",
},
],
}
},
units: ""
}
var locationConfig = {
radar: {
Expand Down Expand Up @@ -142,7 +143,8 @@ var locationConfig = {
golf: {
courses:[],
resorts:[],
}
},
units: "e"
}
var extraCityList = {}
var surrCityList = {}
Expand All @@ -165,6 +167,7 @@ function locationJS() {
locationConfig.airport.airports = []
locationConfig.golf.courses = []
locationConfig.golf.resorts = []
locationConfig.units = "e"
if (window.location.search) {
queryname = window.location.search.split("?")[1]
}
Expand All @@ -181,6 +184,7 @@ function locationGrab() {
locationConfig.mainCity.lon = data.location.longitude
locationConfig.mainCity.state = data.location.adminDistrictCode
locationConfig.mainCity.stateFull = data.location.adminDistrict
locationConfig.units = locationSettings.units
/*$.getJSON("https://pro.ip-api.com/json/?key=AmUN9xAaQALVYu6&exposeDate=false", function(ipdata){
console.log(ipdata.timezone)
timezone = ipdata.timezone;
Expand Down Expand Up @@ -224,6 +228,7 @@ function locationGrab() {
locationConfig.mainCity.lon = data.location.longitude[0]
locationConfig.mainCity.state = data.location.adminDistrictCode[0]
locationConfig.mainCity.stateFull = data.location.adminDistrict[0]
locationConfig.units = (["US", "MM", "LR"].includes(data.location.countryCode[0])) ? "e" : "m"
/*$.getJSON("https://pro.ip-api.com/json/?key=AmUN9xAaQALVYu6&exposeDate=false", function(ipdata){
console.log(ipdata.timezone)
timezone = ipdata.timezone;
Expand Down
1 change: 1 addition & 0 deletions webroot/js/settingspanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ function mainlocfuncs(type) {
//document.cookie = `mainCitySearchType=${locationSettings.mainCity.type}`;
locationSettings.mainCity.val =
document.getElementById("mainloc-data").value;
locationSettings.units = (document.getElementById("tempunit-dropdown").value == "Imperial") ? "e" : "m"
//document.cookie = `mainCitySearchValue=${locationSettings.mainCity.val}`;
$("#setup-extraloc").fadeIn(0);
}
Expand Down
5 changes: 5 additions & 0 deletions webroot/weatherscan.css
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,11 @@ button {
top: 41%;
right: 34%;
}
#tempunit-dropdown {
width: 210px;
top: 48%;
right: 34%;
}
#mainloc-data {
top: 41%;
left: 68%;
Expand Down