Home Posts Topics Members FAQ
gamer2d
10 New Member
I need some help created a google weather api using vb .net.
I found the code online and there are no errors. Problem is that I can't seem to display wether information. Nothing shows up on screen and I am not sure what I did wrong. any ideas?
Expand|Select|Wrap|Line Numbers
- ImportsSystem.Net
- PartialClassUI_MasterPage
- InheritsSystem.Web.UI.MasterPage
- ProtectedSubSearchIB_Click(ByValsenderAsObject,ByValeAsSystem.Web.UI.ImageClickEventArgs)HandlesSearchIB.Click
- DimWeatherDataAsNewWeather.WeatherInfo_Typed
- WeatherData=Weather.Grab_Weather("albany")
- temp.InnerHtml&=WeatherData.location&"--"&WeatherData.forcast_date&"--"&WeatherData.checked_time_date&"--"&WeatherData.humidity&"--"&WeatherData.forcast_date
- EndSub
- EndClass
- <Runtime.CompilerServices.Extension()>
- ModuleWeather
- PublicStructureWeatherInfo_Forecast
- DimDayOfWeekAsString
- DimlowAsDouble
- DimhighAsDouble
- DimiconAsString
- EndStructure
- PublicStructureWeatherInfo_Wind
- DimdirectionAsString
- DimspeedAsDouble
- DimunitAsString
- EndStructure
- PublicStructureWeatherInfo_Typed
- DimFailedAsBoolean
- DimerrormessageAsException
- DimlocationAsString
- Dimforcast_dateAsDateTime
- Dimchecked_time_dateAsDateTime
- DimhumidityAsDouble
- DimhighfAsDouble
- DimlowfAsDouble
- DimhighcAsDouble
- DimlowcAsDouble
- DimcurrenttempCAsDouble
- DimcurrenttempFAsDouble
- Dimpredicted_iconAsString
- Dimcurrent_iconAsString
- Dimcurrent_conditionAsString
- Dimpredicted_conditionAsIEnumerable(OfWeatherInfo_Forecast)
- Dimwind_conditionAsWeatherInfo_Wind
- DimdayAsString
- EndStructure
- <Runtime.CompilerServices.Extension()>_
- PublicFunctionToC(ByValFAsDouble)AsDouble
- Return((F-32)/9)*5
- EndFunction
- <Runtime.CompilerServices.Extension()>_
- PublicFunctionTryParseAsDouble(ByValsAsString)AsDouble
- DimrvAsDouble
- IfDouble.TryParse(s,rv)=FalseThenrv=Double.NaN
- Returnrv
- EndFunction
- <Runtime.CompilerServices.Extension()>_
- PublicFunctionTryParseAsDate(ByValsAsString)AsDateTime
- DimrvAsDateTime
- IfDateTime.TryParse(s,rv)=FalseThenrv=Nothing
- Returnrv
- EndFunction
- PrivateFunctionParseHumidity(ByValsAsString)AsDouble
- IfNotsIsNothingThen
- DimhumRegExAsNewSystem.Text.RegularExpressions.Regex("Humidity:(?<Value>\d+)\w*\%")
- Dimm=humRegEx.Match(s)
- Ifm.Length=0ThenReturnDouble.NaN
- ReturnDouble.Parse(m.Groups("Value").Value)
- EndIf
- EndFunction
- PrivateFunctionParseWind(ByValsAsString)AsWeatherInfo_Wind
- DimrvAsNewWeatherInfo_Wind
- IfNotsIsNothingThen
- DimhumRegExAsNewSystem.Text.RegularExpressions.Regex("Wind\:\s+(?<Direction>[NEWSnews]{1,2})\s+at\s+(?<speed>(?<value>\d+)\s(?<units>\w+)){1}")
- Dimm=humRegEx.Match(s)
- rv.speed=Double.NaN
- Ifm.Length=0ThenReturnrv
- Withrv
- .direction=m.Groups("Direction").Value
- IfDouble.TryParse(m.Groups("value").Value,.speed)=FalseThen.speed=Double.NaN
- .unit=m.Groups("units").Value
- EndWith
- EndIf
- Returnrv
- EndFunction
- PublicFunctionGrab_Weather(ByValLocationAsString)AsWeatherInfo_Typed
- DimGrabWeatherAsNewWeatherInfo_Typed
- WithGrabWeather
- .Failed=True
- Try
- DimxmlAsXDocument=XDocument.Load("http://www.google.com/ig/api?weather="&Location)
- Dimxp=xml.<problem_cause>
- Ifxp.AnyThenReturnGrabWeather
- .location=xml...<city>.@data
- .forcast_date=xml...<forecast_date>.@data.TryParseAsDate
- .checked_time_date=xml...<current_date_time>.@data.TryParseAsDate
- .humidity=ParseHumidity(xml...<humidity>.@data)
- .highf=xml...<high>.@data.TryParseAsDouble
- .lowf=xml...<low>.@data.TryParseAsDouble
- .highc=GrabWeather.highf.ToC
- .lowc=GrabWeather.highc.ToC
- .currenttempC=xml...<temp_c>.@data.TryParseAsDouble
- .currenttempF=xml...<temp_f>.@data.TryParseAsDouble
- '.current_icon="http://www.google.com"&xml...<icon>.@data
- '.predicted_icon="http://www.google.com"&xml...<high>.@data
- .current_condition=xml...<condition>.@data
- .predicted_condition=FromfInxml...<forecast_conditions>_
- SelectNewWeatherInfo_ForecastWith{_
- .DayOfWeek=f.<day_of_week>.Value,_
- .high=f.<high>.@data.TryParseAsDouble,_
- .low=f.<low>.@data.TryParseAsDouble}
- '.icon="http://www.google.com"&f.<icon>.@data}
- .wind_condition=ParseWind(xml...<wind_condition>.@data)
- .day=xml...<day_of_week>.@data
- .Failed=False
- ReturnGrabWeather
- CatchexAsException
- .errormessage=ex
- ReturnGrabWeather
- EndTry
- EndWith
- EndFunction
- EndModule
Jul 9 '15 #1
Subscribe Reply
0 1505
Sign in to post your reply or Sign up for a free account.
Similar topics
13 2361 script for google? by: Mario |last post by: Hello everybody, I am looking for a good script to work a searchprogram for Google .... How can tel me? Not with a logo from google THnx -- -------"""------- ---()--- °?----(_)-----?° | Greetz Mario| Javascript |
3 2539 Weather Prediction Program Help by: JamesLomuscio |last post by: To all who know C++, Im working on a prog that will be able to predict the weather, its too complicated to go into here, but I do need some help. I need to grab all of the information in the file currdat.lst that is in quotes and store them in variables. Sounds simple enough, right? This area of my prog. is complete garbage, so I wont bother to post it. For anyone interested in helping, the next line is line one of C / C++ |
3 1969 Weather Service Webservice Issues by: sduncansca |last post by: Hello We have been using the the National Weather Service webservice(http://www.weather.gov/xml/) for a while. A couple weeks ago they made some changes and moved the url of the wsdl(http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl). I changed the wsdl location in my project and refreshed the web references, but now I am getting error "The underlying connection was closed: The server committed an HTTP protocol violation."... ASP.NET |
6 2129 Google and Asp.Net by: shapper |last post by: Hello, If you make a search in Google for "CNN" you will get the result as follows: CNN.com - Breaking News, US, World, Weather, Entertainment & Video ... CNN.com delivers the latest breaking news and information on the latest top stories, weather, business, entertainment, politics, and more. www.cnn.com/ - 99k - Cached - Similar pages ASP.NET |
1803 " Working in Faith watch this " by: WORKING IN FAITH |last post by: three years I LOVE You Monica More options 1 message - Collapse all WORKING IN FAITH View profile More options Nov 13, 11:29 am three years I LOVE You Monica PHP |
4 5381 Weather Feed and difficulties by: Jake G |last post by: Hi all, I am trying to get a current weather conditions feed working. Yahoo provides a free feed @ http://weather.yahooapis.com/forecastrss?p=XXXXX where XXXXX is a valid US zip code e.g. (http://weather.yahooapis.com/forecastrss?p=43221) The feed is documented @ http://developer.yahoo.com/weather/ This works fine. Where I run into trouble is learing how to use this Javascript |
1 2520 JavaScript implement weather forecast can't run in Firefox by: Wei Jia |last post by: 1.Ajax. 2.http://j.maxmind.com/app/geoip.js for get client city. 3.Google weather API. IE test is passed!But others browser can't,why? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> Javascript |
1102 JQuery Script Not Working: by: neilsy |last post by: So I'm a nube when it comes to JQuery and JavaScript as I mostly write PHP. My Jquery connection via google is working as I've tested it. However I'm not sure whats the problem is. The code is designed to count new messages and display the number of new messages. Code as follows: <script> $(document).ready(function() { var refreshId = setInterval(function(){ $.ajax({ type: "GET", url: "include/php/inboxcount.php", data: 'p=' +<? echo... Javascript |
8683
What is ONU? by: marktang |last post by: ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of... General |
8611 Changing the language in Windows 10 by: Hystou |last post by: Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,... Windows Server |
9031
Maximizing Business Potential: The Nexus of Website Design and Digital Marketing by: jinu1996 |last post by: In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is... Online Marketing |
8876
Discussion: How does Zigbee compare with other wireless protocols in smart home applications? by: tracyyun |last post by: Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some... General |
1 6531
Access Europe - Using VBA to create a class based on a table - Wed 1 May by: isladogs |last post by: The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will... Microsoft Access / VBA |
5867 Couldnt get equations in html when convert word .docx file to html file in C#. by: conductexam |last post by: I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();... C# / C Sharp |
4624 Windows Forms - .Net 8.0 by: adsilva |last post by: A Windows Forms form does not have the event Unload, like VB6. What one acts like? Visual Basic .NET |
2 2341
How to add payments to a PHP MySQL app. by: muto222 |last post by: How can i add a mobile payment intergratation into php mysql website. PHP |
3 2007
Comprehensive Guide to Website Development in Toronto: Expert Insights from BSMN Consultancy by: bsmnconsultancy |last post by: In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive... General |
By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.
To disable or enable advertisem*nts and analytics tracking please visit the page.