From d62cf95a919ab2aad116de6a33dfd13dd0680831 Mon Sep 17 00:00:00 2001 From: coopcool Date: Wed, 27 Jan 2021 15:27:46 -0500 Subject: [PATCH 1/4] testweather --- index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 3233671..5123b10 100644 --- a/index.html +++ b/index.html @@ -8,4 +8,7 @@

Hola Mundo

- \ No newline at end of file + + + +testing the push \ No newline at end of file From 7382ac8caa86ada2d6be23d2b54411d9ff4a91eb Mon Sep 17 00:00:00 2001 From: coopcool Date: Sun, 31 Jan 2021 17:35:26 -0500 Subject: [PATCH 2/4] weatherAppLAB --- WappLab.css | 19 +++++++++++++++++++ WappLab.js | 39 +++++++++++++++++++++++++++++++++++++++ apikey.js | 1 + index.html | 14 -------------- weatherAppLAB.html | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 91 insertions(+), 14 deletions(-) create mode 100644 WappLab.css create mode 100644 WappLab.js create mode 100644 apikey.js delete mode 100644 index.html create mode 100644 weatherAppLAB.html diff --git a/WappLab.css b/WappLab.css new file mode 100644 index 0000000..2130bf8 --- /dev/null +++ b/WappLab.css @@ -0,0 +1,19 @@ +* { + + display: block; + color: rgb(169, 175, 177); + margin: Auto; + margin-bottom: 60px; +} + +title{ + color: black; + font-size: 25px; + font-style: italic; + padding-left: right 25px; + font-weight: normal; +} + +h1 { + color: rgb(41, 28, 226); +} \ No newline at end of file diff --git a/WappLab.js b/WappLab.js new file mode 100644 index 0000000..3b8d9c0 --- /dev/null +++ b/WappLab.js @@ -0,0 +1,39 @@ + + +// calling API +const weather = document.querySelector(".placeName"); + +const userZip = prompt("What's your Zip Code?"); +const userLink = 'http://api.zippopotam.us/us/' + parseInt(userZip); + +var client = new XMLHttpRequest(); + client.open("GET", userLink,); + client.onreadystatechange = function() { + if(client.readyState == 4) { + console.log ('working'); + }; + if(client.readyState == 4 && client.status === 200) { + let zipData = JSON.parse(client.responseText); + const {places: + [{"place name": placeName, state: state, latitude: lat, longitude: lon}] + } = zipData; + weather.textContent = placeName + ", " + state; + + let request = client.open("GET", `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&exclude=minutely,hourly&appid={APIKey}`) + console.log(request) + } + +} + + +!function(d,s,id) { + var js,fjs=d.getElementsByTagName(s)[0]; + if(!d.getElementById(id)){ + js=d.createElement(s);js.id=id;js.src='https://weatherwidget.io/js/widget.min.js'; + fjs.parentNode.insertBefore(js,fjs);} + } + (document,'script','weatherwidget-io-js'); + + +client.send(); + diff --git a/apikey.js b/apikey.js new file mode 100644 index 0000000..92d6faf --- /dev/null +++ b/apikey.js @@ -0,0 +1 @@ +const APIKey = `ff927fa124d7ae776e059bd71c244c1e`; \ No newline at end of file diff --git a/index.html b/index.html deleted file mode 100644 index 5123b10..0000000 --- a/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Document - - -

Hola Mundo

- - - - -testing the push \ No newline at end of file diff --git a/weatherAppLAB.html b/weatherAppLAB.html new file mode 100644 index 0000000..f0bd138 --- /dev/null +++ b/weatherAppLAB.html @@ -0,0 +1,32 @@ + + + + + + + Weather App + + +

Hola Mundo

+ +
+

+
+ +

+
+
+ + BEVERLY HILLS WEATHER + + + + + + + + + From 1698191b0068b14763ea1275f58c0286649217d9 Mon Sep 17 00:00:00 2001 From: coopsmit26 <74632611+coopsmit26@users.noreply.github.com> Date: Sun, 31 Jan 2021 17:43:33 -0500 Subject: [PATCH 3/4] Update apikey.js --- apikey.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apikey.js b/apikey.js index 92d6faf..aba82ce 100644 --- a/apikey.js +++ b/apikey.js @@ -1 +1 @@ -const APIKey = `ff927fa124d7ae776e059bd71c244c1e`; \ No newline at end of file +const APIKey = `ff927fa124d7ae776e059bd71c2#####`; From 68ae67ab64eb6ed8e978e921c3e81fac36a21181 Mon Sep 17 00:00:00 2001 From: coopsmit26 <74632611+coopsmit26@users.noreply.github.com> Date: Sun, 31 Jan 2021 17:44:58 -0500 Subject: [PATCH 4/4] Update apikey.js --- apikey.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apikey.js b/apikey.js index aba82ce..c897d0f 100644 --- a/apikey.js +++ b/apikey.js @@ -1 +1 @@ -const APIKey = `ff927fa124d7ae776e059bd71c2#####`; +const APIKey = `ff927fa124d7ae776e059bd7########`;