Weather Widget

I see all of you using the weather widget for Samurize, except I think the thread where it was posted was lost. So can any of you post a link here? Thanks in advance. By the way, does it change images automatically according to weather conditions. :D

#16677

I got the widget, HEHE, but how do you program the thing to work, and actually detect temperature etc. ?? I really dont get it. :o

#16681

nobody will tell you, ive been trying to figure it out for ages. Its a freeky cult thing. Its the last thing they can do that I cant, Duckies a whore for power. He kills mods so they cant take his place. This isnt the first Goku. :)

#16696

lol you freak :lol:

Duckie just explained in the thread in the "windows modding" forum, how to get the widget and its parent program.

Besides, i dont use these midget widgets shee -

:ph34r:

contrasutra actually had a tutorial explaining exactly how to implement these features on the desktop. Contrasutra=sarcasm.

B)

#16700

I've tried a few times and couldn't get the weather widget going. Duckie stated to change the path in one instance and to place it in the Samurize folder. That is not quite correct . The explanation he gave is not sufficient, otherwise people would not be asking so frequently. He even stated that he had a little problem getting it configure and told people not to give up. That is nice but not much of a tutorial. There's probably more than one string that needs change.

It would be so much simpler to post the strings that should be changed and exactly where each part goes in each folder. An extra 15 minutes of explanation would save people hours of checking things and days of people posting. A list stating what should be the contents of each folder should be a start since it is not clear what goes where. It's great to release something but it is not much use too most if you give half baked explanations and also say you will help in a specific thread only but you don't. It's kind of wasteful to put the time in a modification or an app then leave people just hanging. There is a wide audience here of ****ies and hard moders and when you give an explanations it would be nice if it's helpful to all. Obviously some people got it working but they also do not help the rest of the people that don't get it for whatever reason. So that sucks big time ,especially for ****ies.

Thanks for the effort Duckie but please help make things clearer.

PS: The Search option on the Forum hasn't been working for quite a while I believe.

:D:D

#16715

Well, i'm not the sharpest tool in the shed - but I will help If you tell me where you are as far as configuring this. It took me an hour or so to understand it - after you understand it, it is very easy.

First of all, he had the incorrect path for most of us. It should be something like this (this is my path) this is where your PNG's are stored

C:\Program Files\samurize\Skins\Weather.widget\main.png

There are two places within this file: C:\Program Files\samurize\Configs\Weather.Widget.ini (make sure this file is placed in this path)

Open the .ini file and rename the path (in two places) such as:

[Output 0]

Type=TPNGOutput

FilePath=C:\Program Files\samurize\Skins\Weather.widget\main.png

MasterAlpha=255

Left=0

Top=10

Right=200

Bottom=130

It's 1:09 am, i'll pick it up in the morning if you still need help - We WILL get this configured and working for you very soon - B)

You will have this or this soon! (or whatever you want to configure) - the last configuration does have changing weather images but they are not fancy

3.jpg

2.jpg

#16719

To configure samurize skins on your computer, you have to have a little knowledge of how to edit configs.

I'll do a quick summary which should explain most things:

Extract the contents of the skins you downloaded into a temp folder (this is for ****ies;))

Move the graphical files (png's bmp's etc) to your samurize skin folder, which will usually be X:\Program Files\Samurize\Skins\ (X being your root drive, Most people have C: as their root.)

Move the configuration files (ini's) to your samurize config folder located usually at: X:\Program Files\Samurize\Configs\

If applicable, move any scripts (.vbs, .js etc) to your samurize script folder located usually at: X:\Program Files\Samurize\Scripts

Now that you have everything where it should be you will need to edit the ini for the skin you wish to use.

Open the ini in notepad or wordpad. I'll use test .ini as an example.

Scroll through the contents of the ini file, there will be alot of variables, all you have too look for are system files paths, and change them to the correct path for your computer (ie if there is a line F:\applications\samurize\test\skins\test.png, you'll need to change it to your path X:\program files\samurize\skins\test.png). And save.

Now if you want to change text or edit meter info within samurize to your own wording/values, open up the samurize editor.

Once the editor is open you can choose an ini to edit. All of the images should now show up in the editor, the same way the original author has configured them.

Look for any text you wish to change say for example "blah blah blah" click on this text and it will change the sidebar to use the correct editing function for the object your have selected.

Now there will be a text field in the sidebar asking you to type in whatever text you want the selected item to say. Change the text and click on any area of the editing section. Now your done! (fyi, this tip is useful for those that want to change their city in the weather widget if they dont want to use a script.)

OK! now we need to get those pesky scripts working (if there are any for your chosen theme, if not ignore this section :)

If you have any variables that need changing in your script, like the temp, or location, or condition. Select them in the editor.

Anything that is determined by a script will most likely say : ActiveScript: [not yet executed] these are the variables you'll need to change. Click on the object you want to configure, and now you'll see the side bar change again to the correct editing function for the script object.

Now, choose the script for your skin in the sidebar where it says: select script. ie. the the weather script it might be weather.vbs or weather.js

Now, choose the variable you wish the selected object to possess: (the dropdown will have different varibles such as condition, location, temp, etc.) Once chosen hit the test script button. If all went well you should now have some variable in the object you have selected ie. the current temp, -10 here brrrrrr ;)

Once you have changed all your objects to show the right information, save the 'skin', now you can open the samurize client and chose to open the skin you have juest edited. If all went well you now have a functional samurize skin.

Ooooook Now for the system meter functions....

If the skin you wish to use, uses meters containing system info (perfmon) ie. drive space, memory usage etc... sometimes you will have to edit the meters to show the information for your computer correctly. (because once again computer name and paths will be different from that of the original author)

Ok, so select the meter object you wish to edit. The sidebar will change to the correct editing functions for that item. If you wish to change drive space drives, click the button on the sidebar that will say no drives selected, or will have the name of another drive. Now you can choose whatever drive you wish to be displayed.

Ok now if you select an item thats not displaying properly, and the sidebar shows that it's a permon (usually used to show memory usage, case temp etc.) you will have to select change permon properties, then you can change the computer path, and varibles from there (way too much to explain here).

Now once finished all the editing you wish to do, save your config, and open it in the samurize client.

This post was just meant to be a quick summary, there is alot more to creating samurize scripts than this, but I just wanted to cover the editing of other scripts in a brief manner :) Sorry if some things are worded wierd, I just woke up :) Anyways I hope this helps you '****ies' to get your favourite samurize skins up and running with your machine. Again, I didint go into painful detail, because once in the editor, even a ****ie can fool around and learn how things work. That's how we all learn afterall, trial and error.

Chris

#16750

After selecting your script and function I hit the "test script" button to make sure it's working - if not I will choose another script that works.

#16751

See? This is why we have a community.

I have a family and cannot come here very 5 minutes for answers to your questions.

I applaud you people for coming together to figure it out.

Horray for Non-Laziness!

#16759

Thanks Binary for the lengthy explanation, however I was able to figure it out by myself. Is there really no way to change the picture of the condition automatically, depending on the weather condition?? ;)

#16766

non lazyness? I read half of Binary's explanation and gave up, then got an ice cream cone.

#16767

Originally posted by nrzero@Mar 9 2003, 10:00 PM

Thanks Binary for the lengthy explanation, however I was able to figure it out by myself. Is there really no way to change the picture of the condition automatically, depending on the weather condition?? ;)

It's possible, read through this thread - http://www.samurize.com/forum/viewtopic.php?id=431

#16772

Someday It will look like this

VeryVeryHot.jpg

Darn! Darn! Darn! - It ain't working

Lynchnot:

Nice explanation but I don't have a Weather.Widget folder at all.

So maybe I did not get the whole package he placed out (Duckie)

Maybe if you take the Samurize folder you have intalled (already configured on your computer) and the entire contents then Zip it (it will create an additional zip file leaving the original in place) and post-it or e-mail it to me. I'll re-install Samurize exactly how you have it then take your files and replace mine with yours from the installation and lastly I'll change the City to mine.

I don't seem to be able to get any of the PNGs showing and the Weather script says executing for all values but nothing ever happens. When I try to Edit Config sometimes NortonAntivirus shuts it down because it thinks it's a viral script.

I changed all the Paths but nothing happens on the one I already have.

Bummer! :(

---------------------------------------

Binary:

Very good explanation too but I still don't get the script to execute and no graphics from the PNGs show up just a default graphic even when I change the Paths to the right ones for my computer.

Thanks You !Binary

#16818

Videoman my file is 8MB - 6.86 zipped - how do you want it! - :lol:

#16822

I like it Sunny Side Up! Ha, ha,ha. Got a place to upload on a temporary basis?

#16823

Ok check your PM and let me know when you get it........

opps nevermind - I don't have enough space.

#16824

Here is a guideline of how I configured WeatherWidget. I give all the credit to Lynchknot for his help. I'm not an expert in Samurize so if you have other questions by all means ask somebody else.

Samurize in my set-up will call a file called Weather.widgets.ini which in turn calls another file NOAAWeather.vbs to get the weather info. .If you have different weather script the XXX.ini may call that particular weather.vbs .

WidgetConfig.jpg

This is all I know about Samurize and how it works for me. The weather images will not change in accordance to the weather conditions and according to the Samurize author probably never will since they are only interested in making a system monitor that uses almost no resources and have no interest in going to other functions or enlarging the application. You know everybody has a personal agenda that has a higher priority than helping the users.

Weather.widget.ini File looks like this when you open it w/ Notepad

Look how the script calls in this case NOAAWeather.vbs

[Project]

FileVersion=v0.84 Beta Release

OffsetX=0

OffsetY=0

Width=212

Height=130

Interval=1200

[source 0]

Type=TNullCollector

[Output 0]

Type=TPNGOutput

FilePath=C:\Program Files\samurize\Skins\Weather.widget\main.png

MasterAlpha=255

Left=0

Top=10

Right=200

Bottom=130

[source 1]

Type=TActiveScriptCollector

ScriptName=NOOAWeather.vbs

ScriptFunction=Condition

Interval=1

[Output 1]

Type=TTextOutput

Text=%v

Color=FFFFFFFF

Align=2

FontName=Arial

FontSize=10

FontStyle=[]

LineSpacing=1

NrOfDecimals=0

Left=109

Top=51

Right=190

Bottom=66

[source 2]

Type=TActiveScriptCollector

ScriptName=NOOAWeather.vbs

ScriptFunction=writefile

Interval=5

[Output 2]

Type=TTextOutput

Text=

Color=FFFFFFFF

Align=0

FontName=Tahoma

FontSize=1

FontStyle=[]

LineSpacing=1

NrOfDecimals=0

Left=160

Top=0

Right=212

Bottom=58

[source 3]

Type=TNullCollector

[Output 3]

Type=TPNGOutput

FilePath=C:\Program Files\samurize\Skins\Weather.widget\Smaller Sun.png

MasterAlpha=255

Left=1

Top=0

Right=117

Bottom=116

[source 4]

Type=TActiveScriptCollector

ScriptName=NOOAWeather.vbs

ScriptFunction=Temperature

Interval=1

[Output 4]

Type=TTextOutput

Text=%v°

Color=FFFFFFFF

Align=2

FontName=Lucida Grande

FontSize=18

FontStyle=[fsBold]

LineSpacing=1

NrOfDecimals=0

Left=124

Top=68

Right=194

Bottom=105

[source 5]

Type=TActiveScriptCollector

ScriptName=NOOAWeather.vbs

ScriptFunction=Location

Interval=1

[Output 5]

Type=TTextOutput

Text=Burbank

Color=FFFFFFFF

Align=2

FontName=Arial

FontSize=10

FontStyle=[]

LineSpacing=1

NrOfDecimals=0

Left=80

Top=100

Right=188

Bottom=120

---------------------------------------

You need to find the page that gives you the weather for your location in the U.S. (A NOAA website):

go here:

http://weather.noaa.gov/index.html

Then select your U.S. state, this will take you to different Cities within that State.

You now select the closest City in the "Current Weather Conditions"

You will end up in a page with a similar URL as this one for Fort Bennings,Georgia:

http://weather.noaa.gov/weather/current/KLSF.html

the ending KLSF is the NOAA ending for Fort Bennings Georgia, your URL may be different but with similar address.

You insert the URL for your City below

The NOAAWeather.vbs looks like this when you open it with Notepad

' NOOAWeather v1.0, © By FMJ 2002-12-12

' i got tired of the existing scripts and wanted a more stable news service instead of www.weather.com, which is pants tbh...

' NOOAWeather v1.1 Changed the Visibillity function, and made the Temperatures capable of showing the values in Celsius or Fahrenheit.

' NOOAWeather v1.2 i had forgotten the Windchill and Weather parameters *doooh* they have now been added :)

' NOOAWeather v1.3 apparently the "wheater" data isent always present on the website and therefore is missing in the file.

' So now i just write a little message saying, that the wheater data isent present, but it will be later (when the website updates)

' NOOAWeather v1.4 after request, i trimmed some of the output strings, so the output looks more nice :)

' NOOAWeather v1.5 after request, i added the posibility to show the wind factor in "m/s"

' NOOAWeather v1.6 apparently NOOA doesnt always show the Windchill and Weather data on the website, which means i have to deal with it IF the data isent there.

' NOOAWeather v1.7 same as 1.6, but this time its "Condition"

' NOOAWeather v1.8 same as 1.6, but this time to all the parameters

' NOOAWeather v1.9 made some better errorhandling with none exisisting weather data.

' NOOAWeather v2.0 The visibility meter has no fixed meter, so i had to make the script be aware of "mile" instead of only "Mile(s)"

' NOOAWeather v2.1 Fixed the convertion formel from "km/t" to "m/s".

' NOOAWeather v2.2 Fixed Wind reading, cause sometimes they add extra info to the wind data, which i had never seen before.

' NOOAWeather v2.3 I have forced the "writefile" function to delete the tmp file every time it is run.

' NOOAWeather v2.4 Added a random parameter to the URL, to make sure i aint getting the previous cached URL.

' change the URL in geturl to the URL with the city of your liking, the default url is for Vaerloese, Denmark

geturl = ";http://weather.noaa.gov/weather/current/KLSF.html"

' Change the US setting to True if you want the American values shown, or set it to False if you want European values

US = True ' If you want the wind speed in miles or kilometer per hour, Fahrenheit or Celsious, Miles or Km.

MS = True ' shows wind speed in M/S

tp = "NOOAweather.tmp" 'Name and location of the tmp file.

'**************DONT TOUCH CODE BELOW *************************

CRLF = Chr(10) 'carriage return

Degrees = "°C" 'degrees symbol

Fahrenheit = "°F" 'Fahrenheit symbol

Function Windchill

Windchill = GetHTMLValue("> Windchill ", "", "")

if Windchill <> "N/A" then

temppos = instrrev(Windchill, "> ")+2

Windchill = Mid(Windchill, temppos, len(Windchill))

Windchill = replace(Windchill, CRLF, " ")

If US = false then

temppos = instrrev(Windchill, "(")

temppos2 = instrrev(Windchill, " C)")

Windchill = Mid(Windchill, temppos, temppos2)

Windchill = replace(Windchill, "C", Degrees)

Windchill = replace(Windchill, "(", " ")

Windchill = replace(Windchill, ")", " ")

else

temppos = instrrev(Windchill, "(")-1

Windchill = Mid(Windchill, 1, temppos)

Windchill = replace(Windchill, " F", Fahrenheit)

End If

Else

Windchill = "No windchill data in this weather forecast"

End If

End Function

Function Pressure

Pressure = GetHTMLValue("> Pressure (altimeter) ","", "")

if Pressure <> "N/A" then

temppos = instrrev(Pressure, "> ")+2

Pressure = Mid(Pressure, temppos, len(Pressure))

Pressure = replace(Pressure, CRLF, " ")

If US = false then

temppos = instr(Pressure, "(")

temppos2 = instrrev(Pressure, ")")

Pressure = Mid(Pressure, temppos, (temppos2-temppos))

Pressure= replace(Pressure, "(", " ")

Pressure = replace(Pressure, ")", " ")

else

temppos = instrrev(Pressure, "(")-1

Pressure = Mid(Pressure, 1, temppos)

End If

Else

Pressure = "No pressure data in this weather forecast"

End If

End Function

Function Humidity

Humidity = GetHTMLValue("> Relative Humidity ","", "")

if Humidity <> "N/A" then

temppos = instrrev(Humidity, "> ")+2

Humidity = Mid(Humidity, temppos, len(Humidity))

Humidity = replace(Humidity, CRLF, " ")

Else

Humidity = "No humidity data in this weather forecast"

End If

End Function

Function DewPoint

DewPoint = GetHTMLValue("> Dew Point ", "", "")

if Dewpoint <> "N/A" then

temppos = instrrev(DewPoint, "> ")+2

DewPoint = Mid(DewPoint, temppos, len(DewPoint))

DewPoint = replace(DewPoint, CRLF, " ")

If US = false then

temppos = instrrev(DewPoint, "(")

temppos2 = instrrev(DewPoint, " C)")

DewPoint = Mid(DewPoint, temppos, temppos2)

DewPoint = replace(DewPoint, "C", Degrees)

DewPoint= replace(DewPoint, "(", " ")

DewPoint = replace(DewPoint, ")", " ")

else

temppos = instrrev(DewPoint, "(")-1

DewPoint = Mid(DewPoint, 1, temppos)

DewPoint = replace(DewPoint, " F", Fahrenheit)

End If

Else

Dewpoint = "No dew point data in this weather forecast"

End If

End Function

Function Temperature

Temperature = GetHTMLValue("> Temperature ","", "")

if Temperature <> "N/A" then

temppos = instrrev(Temperature, "> ")+2

Temperature = Mid(Temperature, temppos, len(Temperature))

Temperature = replace(Temperature, CRLF, " ")

If US = false then

temppos = instrrev(Temperature, "(")

temppos2 = instrrev(Temperature, " C)")

Temperature = Mid(Temperature, temppos, temppos2)

Temperature = replace(Temperature, "C", Degrees)

Temperature = replace(Temperature, "(", " ")

Temperature = replace(Temperature, ")", " ")

else

temppos = instrrev(Temperature, "(")-1

Temperature = Mid(Temperature, 1, temppos)

Temperature = replace(Temperature, " F", Fahrenheit)

End If

else

Temperature = "No temperature data in this weather forecast"

End If

End Function

Function Condition

condition = GetHTMLValue("> Sky conditions ","", "")

If Condition <> "N/A" then

temppos = instrrev(Condition, "> ")+2

Condition = Mid(Condition, temppos, len(Condition))

Condition = replace(Condition, CRLF, " ")

Else

Condition = "No condition data in this weather forecast"

End If

End Function

Function Visibility

Visibility = GetHTMLValue("> Visibility ","", "")

if Visibility <> "N/A" then

temppos = instrrev(Visibility, "> ")+2

Visibility = Mid(Visibility, temppos, len(Visibility))

If US = false then

if visibility <> "Unlimited miles" then

If InStr(Visibility, "(") > 1 Then

chrs = instrrev(Visibility, "mile(s)")-2

vis = Mid(Visibility, chrs, 2)

nvis = round(vis * 1.6093)

Visibility = replace(Visibility, vis, nvis)

Visibility = replace(Visibility, "mile(s)", " KM")

else

chrs = instrrev(Visibility, "mile")-2

vis = Mid(Visibility, chrs, 2)

nvis = round(vis * 1.6093)

Visibility = replace(Visibility, vis, nvis)

Visibility = replace(Visibility, "mile", " KM")

end if

end if

End If

Else

Visibility = "No visibility data in this weather forecast"

End If

End Function

Function Location

Location = GetHTMLValue("Current Weather Conditions:

","", "")

if len(Location) = 0 then

Location = "City not found"

End If

End Function

Function Wind

Wind = GetHTMLValue("> Wind ","", "")

if Wind <> "N/A" then

temppos = instr(Wind, "> ")+2

wind = Mid(wind, temppos, len(wind))

sign = instr(Wind, "MPH")+4

If US = false then

sign = instr(Wind, "MPH")+5

spos = instr(Wind, "at ")+3

chrs = instr(Wind, "MPH") - spos

speed = Mid(wind, spos, chrs)

if MS = true then

nspeed = round((speed * 1.609344) / 3.6)

Wind = replace(wind, speed, nspeed)

Wind = replace(wind, "MPH", " m/s ")

else

nspeed = round(speed * 1.609344)

Wind = replace(wind, speed, nspeed)

Wind = replace(wind, "MPH", " km/t")

end if

End If

temppos = instr(Wind, "(")-1

wind1 = Mid(wind, 1, temppos)

temppos = instr(Wind, ")")+1

wind2 = Mid(wind, temppos, (sign-temppos))

wind = wind1 + wind2

Wind = replace(wind, "(", "")

Else

Wind = "No wind data in this weather forecast"

End If

End Function

function Date

Date = GetHTMLValue("

", "", "")

if len(Date) > 0 then

Date = replace(Date, CRLF, " ")

else

Date = "N/A"

End If

end function

Function weather

weather = GetHTMLValue("> Weather ","", "")

If weather <> "N/A" then

temppos = instrrev(weather, "> ")+2

weather = Mid(weather, temppos, len(weather))

weather = replace(weather, CRLF, " ")

Else

weather = "No weather data in this weather forecast"

End If

End Function

Function writefile()

Dim Http

Set Http = CreateObject("Microsoft.XMLhttp")

GetURL = GetURL & "?" & Rnd

Http.Open "GET",GetURL,False

Http.Send

HtmlResult = Http.ResponseText

Set Http = Nothing

set fs=CreateObject("Scripting.FileSystemObject")

If (fs.FileExists(tp)) Then fs.DeleteFile tp, True

set f=fs.CreateTextFile(tp,true)

f.write(htmlresult)

f.close

set f=nothing

set fs=nothing

writefile = "Tempfile written"

End Function

Function GetHTMLValue(LeftBound,RightBound, htmlresult)

Set file_obj = CreateObject ("Scripting.FileSystemObject")

If (file_obj.FileExists(tp)) Then

Set file_path = file_obj.GetFile(tp) ' Creates the connection to the file

set file = file_path.OpenAsTextStream (1, -2) ' Opens the file for reading

htmlresult = file.readall

File.Close ' Closes the file

Set file_path = nothing ' Resets variable

Set file_obj = nothing ' Resets variable

HtmlStart = InStr(HtmlResult, LeftBound) + Len(LeftBound)

HtmlEnd = InStr(HtmlStart, HtmlResult, RightBound)

If HtmlStart <> Len(LeftBound) And HtmlStart > 0 And HtmlEnd > 0 Then

GetHTMLValue = Replace(Mid(HtmlResult, HtmlStart, HtmlEnd - HtmlStart ), " ", " ")

Else

GetHTMLValue = "N/A"

End If

Else

GetHTMLValue = "N/A"

End If

End Function

#16903

Videoman, sorry I sent you my mess! There are files that don't belong in some places - such as the fonts! It is very unorganized but hey, it works! There are also many .ini configurations that were experimental and I did not remove - but I see you took care of it - :)

#16908

why do you guys use this if the png files aren't automatically updated!! :blink::huh:

#16918

Originally posted by theDeviL@Mar 11 2003, 10:55 AM

why do you guys use this if the png files aren't automatically updated!!  :blink:  :huh:

Until a script is written, I have every weather combination loaded - 2 clicks and it's changed.

#16924

i agree its foolish to bother with a weather monitor that doesn't update - i want konfabulator on pc damnit :) - why click to change the condition just to see clouds? get out side more often and actually enjoy that "weather" guys - life is too short

peace

gable

#16964

i agree its foolish to bother with a weather monitor that doesn't update

The weather information does update, the icon-image does not. Unless you think the icon is an accurate picture of what the real environment looks out there, you should always take the initiative to go outside. One thing is not a substitute for another. People don't run their lives based on what the weatherman says most of the time. It is a start in terms of weather programs and hopefully it will have that capacity in the future, if not this program some other program will.

#16984

I am a fool then - but i'm having fun! - :D and it looks cool! Why do you ask stupid questions?

QS.jpg

#16991

Hey Guys,

I guess I am doing something really wrong here, because no matter what I try, I can't get it to display the temp at all. All I get is the "No *** data in this weather forecast" messages, that are in the vbs file. I replaced the url with the one for my city, and all that other stuff, but still no temps.

I looked all over the forum section on the samurize site and here, and besides the posts from Videomann and you Lynchknot, I can not seem to find anything on this particular script. (I did see the other posts, but they don't correlate to this)

Can you guys help me out?

#17006

You may not be able to use your city. Go to weather.com and enter your zip code. Now without scrolling - go to near the bottom left side it will say "as reported from [city, state] - use that.

edit** - of course, this is for the weather.com script - the only one that works for me.

#17009