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

fix weather.py to work with new Yahoo API changes #1058

Merged
merged 1 commit into from
Apr 25, 2016
Merged

fix weather.py to work with new Yahoo API changes #1058

merged 1 commit into from
Apr 25, 2016

Conversation

yoosi
Copy link
Contributor

@yoosi yoosi commented Apr 7, 2016

this closes #1050 and closes #1029

Yahoo no longer provides RSS feeds for weather.
bot now uses their most current API instead.

@maxpowa
Copy link
Contributor

maxpowa commented Apr 11, 2016

This is good but it is still using XML parsing - with the query.yahooapis.com urls, we can use &format=json to avoid XML completely.

@yoosi
Copy link
Contributor Author

yoosi commented Apr 19, 2016

@maxpowa I'm still a bit new to git. Should a change like that get its own pull request or should I commit to this branch?

@maxpowa
Copy link
Contributor

maxpowa commented Apr 19, 2016

New PR. As it is, this one doesn't fix the problem - I tested it the other day and it was still erroring.

@yoosi
Copy link
Contributor Author

yoosi commented Apr 22, 2016

@maxpowa What errors are you receiving? I've been running this updated module since I opened my pull request without issue.

uzip = first_result.get('postal').get('#text') or ''
bot.reply('I now have you at WOEID %s (%s%s, %s, %s %s)' %
(woeid, neighborhood, city, state, country, uzip))
# uzip = first_result.get('postal').get('#text') or ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole section, from here to the end of the diff, is messy. The commented-out code should simply be removed.

@yoosi
Copy link
Contributor Author

yoosi commented Apr 24, 2016

@dgw I removed the messy code

@dgw
Copy link
Member

dgw commented Apr 24, 2016

👍 though I suspect that these commits should all be squashed into one before merging.

@@ -178,6 +178,5 @@ def update_woeid(bot, trigger):
city = first_result.get('name')
state = first_result.get('admin1').get('#text') or ''
country = first_result.get('country').get('#text') or ''
uzip = first_result.get('postal').get('#text') or ''
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yahoo's new API doesn't always return a zip code

@yoosi
Copy link
Contributor Author

yoosi commented Apr 25, 2016

@dgw I squashed the commits. It's much cleaner now.

@maxpowa maxpowa merged commit 4e81e69 into sopel-irc:master Apr 25, 2016
@dgw
Copy link
Member

dgw commented Apr 25, 2016

👍 @yoosi

@yoosi yoosi deleted the fix-weather branch April 25, 2016 17:03
@dgw dgw mentioned this pull request May 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants