<% Dim gscity, gsstate, gsInfoCurrent, gsInfoToday, gsInfoTomorrow, bwAvail Dim root, quote, q, nodeList, item, rsWeatherIcon, todaysIcon, rsWeatherIcon2, todaysIcon2 ' Main set gsInfoCurrent = Server.CreateObject("Scripting.Dictionary") set gsInfoToday = Server.CreateObject("Scripting.Dictionary") set gsInfoTomorrow = Server.CreateObject("Scripting.Dictionary") 'strSql="select * from tblUserWeather where User_ID='"&session("users_userID")&"'" 'set rsA_Weather=connect.execute(strSql) 'if rsA_Weather.eof then gsCity = "Penn Yan" gsState = "NY" 'mycity = "Penn Yan" 'mystate = "NY" 'else ' gsCity = rsA_Weather("City_ID") ' gsState = rsA_Weather("State_ID") 'mycity = gsCity 'mystate = gsState 'end if getInfo gsCity, gsState,gsInfoCurrent, gsInfoToday, gsInfoTomorrow ' Code to get the weather information ' wInfoCurrent and wInfoToday must be an exisiting Dictionary Object Sub GetInfo(mycity, mystate, wInfoCurrent, wInfoToday, wInfoTomorrow) Dim srvXmlHttp Dim xmlResult ' Create the object that will retrieve an XML document by using HTTP 'Set srvXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP") Set srvXmlHttp = Server.CreateObject("Msxml2.XMLHTTP") ' open a connection to get the weather info on error resume next srvXmlHttp.Open "GET","http://www.accuweather.com/voxml/xmlus?state="&gsState&"&city="&gsCity, false srvXmlHttp.Send() if not err.number = 0 then bwAvail = false exit sub end if ' put the result in xmlResult Set xmlResult = srvXmlHttp.responseXML Set srvXmlHttp = Nothing 'Check for errors Set root = xmlResult.documentElement ' collect the info from the current weather conditions Set quote = root.selectSingleNode("current") if not err.number = 0 then bwAvail = false exit sub end if bwAvail = true Set nodeList = quote.childNodes For Each item In nodeList if not (item.nodeName="day") then if item.nodeName="timestamp" then wInfoCurrent.Add "timezone", item.attributes(0).text end if wInfoCurrent.Add item.nodeName,item.text on error resume next end if Next ' collect the info from the conditions today Set quote = root.selectsinglenode("current/day") Set nodeList = quote.childNodes For Each item In nodeList if item.nodename<>"day" then if item.nodeName="conditions" then wInfoToday.Add "wxcode",item.attributes(0).text end if if item.nodeName="pressure" then wInfoToday.Add "pressure_unit",item.attributes(0).text end if if item.nodeName="windspeed" then wInfoToday.Add "unit",item.attributes(0).text end if on error resume next wInfoToday.Add item.nodeName,item.text end if Next ' piece to get high for today set q = root.selectnodes ("forecast/day[0]/high") wInfoToday.Add "high",q(0).text set q = root.selectnodes ("forecast/day[0]/low") wInfoToday.Add "low",q(0).text ' new piece to get the info for tomorrow ' order: ' dayname ex. name, "SATURDAY" ' wxcode ex wxcode, "03" ' conditions ex. conditions, "RAIN" ' high ex. high, 75 ' low ex. low, 56 ' day[0] = today ' day[1] = tonight ' day[2] = tomorrow 'set q = root.selectnodes("forecast/day[2]/*") 'for each item in q ' for each node for tomorrow 'if item.nodeName="conditions" then ' wInfoTomorrow.Add "wxcode",item.getAttribute("wxcode") 'end if 'wInfoTomorrow.Add item.nodeName, item.Text 'Next End Sub %> Weather
Weather

The Greater Penn Yan, NY area has a moderate Northeast climate, suffering few extremes, while enjoying a full four seasons. Average highs in the summer months are near 80 degrees, with average lows in the high 50s to low 60s. The warm summer weather includes just enough rain to keep lawns green and flowers blooming. Backyard gardeners delight in the ample growing season and relatively trouble-free weather.

Autumns are mild and dry, with magnificent fall foliage decorating the hills and valleys. Peak season for viewing fall foliage is typically early to mid-October and the glorious autumn weather frequently extends well into November.

Blanketed in sparkling white snow, trees and hilltops glisten through most of January and February. During the coldest months of winter average highs hover around the freezing mark, with lows in the teens and twenties. Average snowfall per year is 82.4 inches. While snowfall totals may seem substantial, most of it falls in frequent, small amounts with only a few major snowstorms a year.

Area Temperatures

Current Conditions
<% IF gsInfoToday("temperature")="" THEN Response.write " Weather Report for Penn Yan NY could not be found" ELSE Response.write " Penn Yan NY " & gsInfoToday("temperature") & "ºF, " & lcase(gsInfoToday("conditions")) & "
" Response.write " High: " & gsInfoToday("high") & "
" Response.write " Low: " & gsInfoToday("low") END IF %> <% 'Penn Yan NY <%=gsInfoToday("temperature")ºF, <%=lcase(gsInfoToday("conditions")) 'High: <%=gsInfoToday("high")
'Low: <%=gsInfoToday("low") %> more
Months

Avg. Highs

Avg. Lows
Avg. Precipitation

Jan

29
15
2.4”

Feb

31
16
2.3”

Mar

40
24
2.9”

Apr

54
35
3.3”

May

66
46
3.3”

Jun

74
55
3.6”

Jul

79
60
3.6”

Aug

77
58
3.5”

Sep

69
50
3.2”

Oct

58
40
2.9”

Nov

45
31
3.2”

Dec

33
20
2.9”
(Source: Weatherbase.com)