GetWeather works again Thread last updated on 2003-10-30 21:34:12

Posted by member 51749 on 2003-09-28 00:21:06

Hey.

ive setup getweather as well as i can tell. only things im having issues with are litestep actually using the VBS script (i can however run it manually by dbl clicking the file - tedious!), and the update process itself...whenever i try to update my weather stats from the website, it returns N/A to everything.

can some kind soul shed some light as to where im going wrong, and perhaps guide me to the path of workingness? :/

cheers!

Posted by member 36955 on 2003-09-28 02:56:08 link

the current version of getweather hasnt worked in quite a while... the html format of the page has changed, so thats why all of the elements are n/a...

i have an updated version that worked for a while, and i emailed it to brian, who wrote the script, but he didnt respond... i was going to just release it, but it stopped working a few months ago, and now the script doesnt do anything, and the wscript process never terminates. i narrowed the problem down to the section that sends the http get request...
Set http = createObject("microsoft.xmlHttp")
http.open "GET",WeatherURL,False 'Synchronous mode - wait for URL to respond.
If Err.Number <> 0 Then
MsgBox WeatherURL & " " & Err.Description
Err.Clear
WScript.Quit
End If
http.send "" 'this line never finishes executing

and since i know hardly anything about vbasic, i dont know what the problem might be... it could be that it is specific to my computer, so if you want to try it out, i can send you the version i updated... i get the feeling it might be specific to my computer, since i only changed the regexps that parse the info after it has been downloaded, and your computer seems to be able to get through that line just fine... so try my version here and see if that works

Posted by member 51749 on 2003-09-28 13:21:33 link

cheers man.

gave it a go, looks like it runs fine, except its still outputting N/A. i might have to edit what the script looks for in the website. leave that for another day.

thanks again

Posted by member 51749 on 2003-10-03 05:16:42 link

hmmm...hi everyone.

ive almost got a working weather script, accomplished by splicing together getWeather code and some code from a Samurize vbscript (!). works quite well.

the only problem im having is with the label!

my label calls variables $conditions$, $feelslike$, $barometer$, $temperature$, $wind$, and $WX1condimg$, but only reads them once (from a text file included from a .rc), on litestep startup/refresh. even using labelUpdateInterval 2000, its not updating its dynamic content until i refresh.

have a look at my code, see whats going on here.

gwtxtY 4
gwtxtX 1065
gwtxtWidth 200
gwtxtHeight 34
gwtxtJustify Left
gwtxtTransparent True
gwtxtText "Conditions: $Conditions$\nTemperature: $Temperature$\nWind: $Wind$\nPressure: $Barometer$"
gwtxtUpdateInterval 2000

gwimgY 6
gwimgX 1030
gwimgWidth 30
gwimgHeight 30
gwimgImage $WX1CondImage$
gwimgUpdateInterval 2000


spot anything odd? is there a way to reload only certain labels? or even better, is there a way to refresh certain string variables?

Posted by member 1 on 2003-10-03 07:11:46 link

You need to setup your mzScript that runs the GetWeather script to update your label. Now...unfortunatly you need a special version of mzScript for it to actually update, available from Phil from Leaf R&D. Otherwise you will need to setup your script to reload the module.

Posted by member 51749 on 2003-10-06 00:51:08 link

ok guys, ive finally done it. ive got a weather script returning valid data, and its being displayed in a label.

problem is, i dont know if the authors will let me release it. also, although it uses weather.com, its highly customised for my location and litestep configuration. i could clean it up, but it might take a while, and that doesnt address the problem of permission to release. and there are functions i havent tested/dont use yet, which most likely wont work yet.

right now, it returns conditions, temperature, apparent temperature, wind speed and direction, pressure (in millibars), and chance of rain.

it uses bits and pieces from getWeather, but its mostly the AucklandWX script for Samurize, modified to be run with litestep. id need to contact whoever made it, but im not sure i can.

would anyone like it? i could clean it up if i have enough support.

Posted by member 36955 on 2003-10-06 07:05:42 link

i would like it... i miss having a weather module(:
i coud probably help clean it up if you want

Posted by member 51749 on 2003-10-23 13:03:58 link

sorry about the long absence.

the html has changed again. bastards. i think they are changing it on a regular basis now, making any info getting script redundant. ive somewhat fixed it, but im not sure if itll always work. and it cant get temperature (at the moment im using feelslike).

might take a little while, although uni finishes this week. well see what i can come up with.

Posted by member 36955 on 2003-10-23 20:06:56 link

my suggestion would be to try getting it from a website other than weather.com, such as wunderground.com or http://www.nws.noaa.gov/

the script would probably have to be rewritten, but weather.com seems to be very unfriendly to screen scrapers now that they have their own weather desktop program

Posted by member 51749 on 2003-10-25 15:18:15 link

ok, ill look into wunderground.

for now, the script works again. its not very nice code :/ 2 regexps one after the other, just to get one result.

ill get onto cleaning it up, and post it somewhere.

Posted by member 1 on 2003-10-25 15:57:21 link

noaa would be my choice for US weather...it dumps to a flat text file even. Check here

Posted by member 36955 on 2003-10-25 18:39:50 link

is there a way for it to show forecasts in that text file?
foreacsts are really the main thing i look for in a weather module/script, since i generally have a decent idea of what the weather is like right now, but i dont necessarily know what its going to be like tomorrow. even if it is just a 3 day forecast or something like that

Posted by member 1 on 2003-10-25 20:00:27 link

NOAA does not put a forcast in there and the forcasts they do have are REALLY weak.

Posted by member 36955 on 2003-10-26 01:34:01 link

well, i was trying to get the getweather script to work with wunderground, but when it requests the page, the line
MsgBox WeatherURL & " " & Err.Description

from the code snippet in my first reply is returning "Object not a collection" as Err.Description
what does this mean?

edit: never mind, its an error left behind from somewhere else that wasnt cleared

Posted by member 51749 on 2003-10-26 20:23:50 link

can i get you guys to test this on your boxes?

works fine on mine, but it broke on my 2nd pc.
anyway, have a go.

Posted by member 36955 on 2003-10-26 20:56:38 link

well... this wont unzip for me (and 7-zip gives a very unhelpful error message - Error: error)... could you try uploading it again?

Posted by member 51749 on 2003-10-27 02:21:00 link

sorry! im officially an iddy. uploaded in ASCII. fixed now.

Posted by member 51749 on 2003-10-29 20:06:55 link

noones replying....ominous :P

anyway, ive just about finished a little function that downloads the satellite image and displays it as a label when you mouseover the weather conditions label. only problem i have is that its a .jpg, and it doesnt look like label.dll can use these as a background. is this true?

Posted by member 1 on 2003-10-30 09:25:59 link

yup...LS don't do JPG

Posted by member 36955 on 2003-10-30 19:43:31 link

im testing it now... ill report back on how it works

edit: well, it works... it would be nice if it supported all of the stuff that getweather did though, like forecasts... ill see what i can do about that

also, it would make more sense for this to be included under $personaldir$ rather than $modulesdir$

and you shouldnt have to hardcode the rc file fo things like connected.dll, and stuff like that, and especially for label... if a theme has a weather label, it will want to configure that stuff by itself, and putting loadmodule lines in the rc by default isnt a good thing, as it can do nasty stuff if those files are already loaded... i liked getweather's method better, where you just ran the script, and it dumped the results to a text file that you could do whatever you wanted with... much easier to configure that way

on a side note, my modified version of getweather works again when using the beta.weather.com address

Posted by member 51749 on 2003-10-30 21:34:12 link

well, good points, but i wanted this whole thing to be more of a self contained module. having all the config stuff in a single file made sense to me. as for the other functions, yer, itd be nice, but at the mo i dont have a whole lot of time, so i fixed what i needed.