Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for broken code due to NOAA site changes. Bug #631 #635

Merged
merged 3 commits into from
Oct 22, 2016

Conversation

waynieack
Copy link
Contributor

I created a sub called get_zone that gets the 3 letter zone from NOAA using the search function on the NOAA site with the user defined city and state, so zone is no longer needed when get_weather is called. This allows for the new code to be used with no changes to user code or the mh.private.ini.

WeatherNOAA.pm was run through perl tidy and seems to have many formatting changes so although I made few changes, the diff shows many.

@marcmerlin
Copy link
Collaborator

I'm not sure what's going on with the whitespace changes, but I also ran perltidy against your code and I'm also getting issues, so I don't think you did anything wrong.
Thanks for giving us just one change in this review. Btw, you could have undone the bad commit you did with git reset --hard HEAD^

I downloaded your code and tried it locally, and it seems to work fine, outside of "current conditions"
gargamel:/var/local/src/misterhouse/mh/bin# ./get_weather -city "SAN JOSE" -state CA

Getting the current weather for SAN JOSE, CA
Getting the forecast for SAN JOSE, CA

Current conditions: No data available

The forecast is As of 9:00pm Fri Oct 21, 2016:
Rest Of Tonight: Mostly clear. Lows in the lower 50s. Northwest winds 5 to
10 mph.
Saturday: Sunny. Highs in the mid 70s. Northwest winds 5 to 15 mph.
Saturday Night: Mostly clear. Lows around 50. North winds 5 to 15 mph.
Sunday: Sunny in the morning then becoming partly cloudy. Highs in the
lower 70s. North winds around 5 mph, becoming southwest in the
afternoon.
Sunday Night: Mostly cloudy. Lows in the lower 50s. Southeast winds 5 to 10
mph.
Monday: Mostly cloudy. A slight chance of rain. Highs in the lower 70s.
Monday Night And Tuesday: Mostly cloudy. A slight chance of rain. Lows in
the lower to mid 50s. Highs in the lower 70s.
Tuesday Night: Mostly cloudy. Lows in the lower 50s.
Wednesday And Wednesday Night: Partly cloudy. Highs in the lower 70s. Lows
in the lower 50s.
Thursday Through Friday: Mostly cloudy. A chance of rain. Highs in the
upper 60s. Lows in the mid 50s. && Temperature / precipitation san jose
53 75 52 72 / 0 0 10 10 morgan hill 51 76 48 71 / 0 0 10 10

Either way, this is much better than the current broken state of things, so I'm merging it, thank you.

@marcmerlin marcmerlin merged commit e96c86f into hollie:master Oct 22, 2016
@waynieack
Copy link
Contributor Author

I figured out how to fix the missing Current conditions, it SHOULD now for
for everyone.

I created a new pull request #636.

/opt/misterhouse/mh/bin/get_weather -city "SAN JOSE" -state CA

Getting the current weather for SAN JOSE, CA
Getting the forecast for SAN JOSE, CA

Current conditions: At 9:00 AM, San Jose Arpt, CA conditions were partly
sunny skies at
57 degrees , wind was calm. The relative humidity was 89%, and
barometric pressure was rising from 29.91 inches.

The forecast is As of 6:00am Sat Oct 22, 2016:
Today: Sunny. Highs in the mid 70s. Northwest winds 5 to 15 mph.
Tonight: Mostly clear. Lows around 50. North winds 5 to 15 mph.
Sunday: Sunny in the morning then becoming partly cloudy. Highs in the
lower 70s. Northwest winds 5 to 10 mph.
Sunday Night: Mostly cloudy. Lows in the lower 50s. West winds 10 to 15
mph, becoming southeast 5 to 10 mph after midnight.
Monday: Mostly cloudy. A slight chance of rain in the afternoon. Highs in
the lower 70s. South winds 5 to 10 mph. Chance of rain 20 percent.
Monday Night: Mostly cloudy. A slight chance of rain. Lows in the lower to
mid 50s.
Tuesday: Mostly cloudy. A slight chance of rain. Highs in the lower 70s.
Tuesday Night: Mostly cloudy. Lows in the lower 50s.
Wednesday And Wednesday Night: Partly cloudy. Highs in the lower 70s. Lows
in the lower 50s.
Thursday Through Friday: Mostly cloudy. A chance of rain. Highs in the
upper 60s. Lows in the lower 50s. && Temperature / precipitation san
jose 74 52 72 / 0 10 10 morgan hill 76 48 71 / 0 10 10

_Wayne

On Sat, Oct 22, 2016 at 1:11 AM, Wayne Gatlin [email protected] wrote:

git reset --hard HEAD^ <<< I'll put that in my notes for next time. I'll
be honest, git has been giving me fits trying to get everything back in
order mainly because I have no idea what I am doing with it :) and I am not
a developer so the terminology is very foreign to me.

When I run it for Baton Rouge I get the current condition... I'll look
into why it does not work for you. There are several URLs that pull the
same or similar data, maybe one of the others will work better.

Getting the current weather for BATON ROUGE, LA
Getting the forecast for BATON ROUGE, LA

Current conditions: At 10:00 PM, Baton Rouge, LA conditions were clear
weather at 59 degrees ,
wind was north at 6 mph. The relative humidity was 67%, and
barometric pressure was rising from 30.14 inches.

The forecast is As of 3:55pm Fri Oct 21, 2016:
Tonight: Clear. Lows in the mid 40s. North winds 5 to 10 mph.
Saturday: Sunny. Highs in the mid 70s. Northeast winds to 10 mph.
Saturday Night: Clear. Lows in the upper 40s. Light and variable winds
becoming northeast up to 5 mph after midnight.
Sunday: Sunny. Highs around 80. Southeast winds to 5 mph.
Sunday Night: Clear. Lows in the mid 50s. East winds to 5 mph.
Monday: Partly cloudy. Highs in the lower 80s.
Monday Night: Mostly clear. Lows in the mid 50s.
Tuesday: Sunny. Highs in the mid 80s.
Tuesday Night: Mostly clear. Lows in the upper 50s.
Wednesday: Partly cloudy. Highs in the mid 80s.
Wednesday Night: Partly cloudy. Lows in the lower 60s.
Thursday: Sunny. Highs in the mid 80s.
Thursday Night: Mostly clear. Lows in the lower 60s.
Friday: Sunny. Highs in the mid 80s.

_Wayne

On Fri, Oct 21, 2016 at 11:41 PM, Marc MERLIN [email protected]
wrote:

I'm not sure what's going on with the whitespace changes, but I also ran
perltidy against your code and I'm also getting issues, so I don't think
you did anything wrong.
Thanks for giving us just one change in this review. Btw, you could have
undone the bad commit you did with git reset --hard HEAD^

I downloaded your code and tried it locally, and it seems to work fine,
outside of "current conditions"
gargamel:/var/local/src/misterhouse/mh/bin# ./get_weather -city "SAN
JOSE" -state CA

Getting the current weather for SAN JOSE, CA
Getting the forecast for SAN JOSE, CA

Current conditions: No data available

The forecast is As of 9:00pm Fri Oct 21, 2016:
Rest Of Tonight: Mostly clear. Lows in the lower 50s. Northwest winds 5 to
10 mph.
Saturday: Sunny. Highs in the mid 70s. Northwest winds 5 to 15 mph.
Saturday Night: Mostly clear. Lows around 50. North winds 5 to 15 mph.
Sunday: Sunny in the morning then becoming partly cloudy. Highs in the
lower 70s. North winds around 5 mph, becoming southwest in the
afternoon.
Sunday Night: Mostly cloudy. Lows in the lower 50s. Southeast winds 5 to
10
mph.
Monday: Mostly cloudy. A slight chance of rain. Highs in the lower 70s.
Monday Night And Tuesday: Mostly cloudy. A slight chance of rain. Lows in
the lower to mid 50s. Highs in the lower 70s.
Tuesday Night: Mostly cloudy. Lows in the lower 50s.
Wednesday And Wednesday Night: Partly cloudy. Highs in the lower 70s. Lows
in the lower 50s.
Thursday Through Friday: Mostly cloudy. A chance of rain. Highs in the
upper 60s. Lows in the mid 50s. && Temperature / precipitation san jose
53 75 52 72 / 0 0 10 10 morgan hill 51 76 48 71 / 0 0 10 10

Either way, this is much better than the current broken state of things,
so I'm merging it, thank you.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#635 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFZ3eR7z5mAHr-tXtBhIfUHVbOnUq6v1ks5q2ZQHgaJpZM4KdwDc
.

@waynieack
Copy link
Contributor Author

git reset --hard HEAD^ <<< I'll put that in my notes for next time. I'll be
honest, git has been giving me fits trying to get everything back in order
mainly because I have no idea what I am doing with it :) and I am not a
developer so the terminology is very foreign to me.

When I run it for Baton Rouge I get the current condition... I'll look into
why it does not work for you. There are several URLs that pull the same or
similar data, maybe one of the others will work better.

Getting the current weather for BATON ROUGE, LA
Getting the forecast for BATON ROUGE, LA

Current conditions: At 10:00 PM, Baton Rouge, LA conditions were clear
weather at 59 degrees ,
wind was north at 6 mph. The relative humidity was 67%, and
barometric pressure was rising from 30.14 inches.

The forecast is As of 3:55pm Fri Oct 21, 2016:
Tonight: Clear. Lows in the mid 40s. North winds 5 to 10 mph.
Saturday: Sunny. Highs in the mid 70s. Northeast winds to 10 mph.
Saturday Night: Clear. Lows in the upper 40s. Light and variable winds
becoming northeast up to 5 mph after midnight.
Sunday: Sunny. Highs around 80. Southeast winds to 5 mph.
Sunday Night: Clear. Lows in the mid 50s. East winds to 5 mph.
Monday: Partly cloudy. Highs in the lower 80s.
Monday Night: Mostly clear. Lows in the mid 50s.
Tuesday: Sunny. Highs in the mid 80s.
Tuesday Night: Mostly clear. Lows in the upper 50s.
Wednesday: Partly cloudy. Highs in the mid 80s.
Wednesday Night: Partly cloudy. Lows in the lower 60s.
Thursday: Sunny. Highs in the mid 80s.
Thursday Night: Mostly clear. Lows in the lower 60s.
Friday: Sunny. Highs in the mid 80s.

_Wayne

On Fri, Oct 21, 2016 at 11:41 PM, Marc MERLIN [email protected]
wrote:

I'm not sure what's going on with the whitespace changes, but I also ran
perltidy against your code and I'm also getting issues, so I don't think
you did anything wrong.
Thanks for giving us just one change in this review. Btw, you could have
undone the bad commit you did with git reset --hard HEAD^

I downloaded your code and tried it locally, and it seems to work fine,
outside of "current conditions"
gargamel:/var/local/src/misterhouse/mh/bin# ./get_weather -city "SAN
JOSE" -state CA

Getting the current weather for SAN JOSE, CA
Getting the forecast for SAN JOSE, CA

Current conditions: No data available

The forecast is As of 9:00pm Fri Oct 21, 2016:
Rest Of Tonight: Mostly clear. Lows in the lower 50s. Northwest winds 5 to
10 mph.
Saturday: Sunny. Highs in the mid 70s. Northwest winds 5 to 15 mph.
Saturday Night: Mostly clear. Lows around 50. North winds 5 to 15 mph.
Sunday: Sunny in the morning then becoming partly cloudy. Highs in the
lower 70s. North winds around 5 mph, becoming southwest in the
afternoon.
Sunday Night: Mostly cloudy. Lows in the lower 50s. Southeast winds 5 to 10
mph.
Monday: Mostly cloudy. A slight chance of rain. Highs in the lower 70s.
Monday Night And Tuesday: Mostly cloudy. A slight chance of rain. Lows in
the lower to mid 50s. Highs in the lower 70s.
Tuesday Night: Mostly cloudy. Lows in the lower 50s.
Wednesday And Wednesday Night: Partly cloudy. Highs in the lower 70s. Lows
in the lower 50s.
Thursday Through Friday: Mostly cloudy. A chance of rain. Highs in the
upper 60s. Lows in the mid 50s. && Temperature / precipitation san jose
53 75 52 72 / 0 0 10 10 morgan hill 51 76 48 71 / 0 0 10 10

Either way, this is much better than the current broken state of things,
so I'm merging it, thank you.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#635 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFZ3eR7z5mAHr-tXtBhIfUHVbOnUq6v1ks5q2ZQHgaJpZM4KdwDc
.

@marcmerlin
Copy link
Collaborator

It works now that I fixed another file. see #637

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants