Query internet db for information

Discussion in 'C#' started by bbcompent1, Feb 18, 2010.

  1. #1
    Hello everyone, I'm trying to figure out how to query the average temperature for a given zip code programmatically. Are there any sites that allow direct querying or something similar? What I'm wanting to do is to present the current temperature and yearly average temperature for a zipcode. This zipcode would be provided by my database and in turn I would use that variable to do my query. Any ideas? Thanks in advance :)
     
    bbcompent1, Feb 18, 2010 IP
  2. bbcompent1

    bbcompent1 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I have decided to utilize XML for this purpose. I'm a little rusty so please help me out. The address I am using for the information is
    http://weather.yahooapis.com/forecastrss?p=10101
    Code (markup):
    What I need to understand is how to use this feed as an ADODB recordset. Here is what I have so far:

    
    <%
    objXML.Load ("http://weather.yahooapis.com/forecastrss?p=10101"
    
    If objXML.parseError.errorCode <> 0 Then
    Response.Write "<p><font color=red>Error loading the weather data, contact the webmaster.</font></p>"
    Response.End
    End If
    %>
    
    Code (markup):
    What I'm trying to get out of this is the current temperature for that zip code. Any help would be most appreciated. Thank you.
     
    bbcompent1, Feb 19, 2010 IP
  3. chengary

    chengary Banned

    Messages:
    88
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    ADODB recordset.
     
    chengary, Feb 20, 2010 IP
  4. sdnsoft

    sdnsoft Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #4
    Better use LINQ to XML it's VERY EASY.

    Quick sample for parsing XML document:
    http://www.hookedonlinq.com/LINQtoXML5MinuteOverview.ashx
     
    sdnsoft, Feb 22, 2010 IP
  5. bbcompent1

    bbcompent1 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Well, LINQ would be fine if I was using asp.net however this is classic ASP. Someone mentioned ADODB for the XML...do you have any examples of that?
     
    bbcompent1, Feb 25, 2010 IP
  6. zolpeti

    zolpeti Greenhorn

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #6
    search for : developer yahoo weather in google, there are also examples provided by yahoo how to parse xml
     
    zolpeti, Feb 25, 2010 IP