Open martynjy opened 8 years ago
On 08/07/2016 11:08 AM, martynjy wrote:
Hi
What is the format for adding a location?
Is it possible to add a specific station? eg, IKINGSLY8
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ewwaller/wunderground.py/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AFujt8ohHOjgf7pGFfD05u_XD3vlZxHoks5qdh8VgaJpZM4JejVq.
Hi,
Yeah, I suppose that could use some clean up. Sorry about that.
I used the location you gave to search for King's Lynn, GB on Weather Underground. From the URL that search returned, I found that the location is 'locid:UKXX0504'. So, I tried it. Then I set it for metric.
If you have any issues, run it with the --debug option and send me the output. Note that will reveal your API key, so you may want to redact that bit.
ewaller@turing ~ [1]1011 %wunderground.py -l locid:UKXX0504 Location : King's Lynn, United Kingdom Sun, 07 Aug 2016 19:40:56 +0100 Condition : Clear Temperature :74.8 F (23.8 C) Humidity :46% / Dewpoint :53 F (12 C) Pressure :30.04 in hg. Trend - Visibility :6.2mi Wind: West @ 5.6 mph precip :0.00 in (0 mm) Moon : Waxing Crescent 23% Sunrise : 5:27 ; Sunset : 20:39 Weather data by Weather Underground (http://www.wunderground.com) ewaller@turing ~ 1012 %wunderground.py --metric Location : King's Lynn, United Kingdom Sun, 07 Aug 2016 19:40:56 +0100 Condition : Clear Temperature :74.8 F (23.8 C) Humidity :46% / Dewpoint :53 F (12 C) Pressure :1017 mb Trend - Visibility :10.0km Wind: West @ 9.0 kph precip :0.00 in (0 mm) Moon : Waxing Crescent 23% Sunrise : 5:27 ; Sunset : 20:39 Weather data by Weather Underground (http://www.wunderground.com) ewaller@turing ~ 1013 %
Hope you enjoy the program. It looks as if I may need to make it a bit more robust :)
Cheers, Eric
Hi Eric
The 'pws:' prefix works:
wunderground.py -l pws:IKINGSLY8
The program is great. In fact it is exactly what I have been looking for.
It is the initial release after all and you will refine it over time!
Added some logic to detect if Wunderground.com reports an error that there is no matching logic and/or if the location is ambiguous (For example, 'London' has about 7 locations outside of the one in the UK). The program had previously errored out with a backtrace and an ungraceful exit.
Hi Eric
As you know (previous posts) I have it working for me using pws:<STATION>
but I am trying to help iron out the bugs / issues.
Again using 'King's Lynn' as the example it does not work in a simple manner!
wunderground.py -l King's Lynn
results in a prompt.
As there is an apostrophe and a space does it require using escape?
Hi
What is the format for adding a location?
Is it possible to add a specific station? In 'pywu' for example I could do the following:
pywu fetch <api key> pws:IKINGSLY8