Click here to Skip to main content
15,881,172 members
Articles / Programming Languages / Visual Basic

Weather Using VB.NET and Yahoo RSS!

Rate me:
Please Sign up or sign in to vote.
4.05/5 (13 votes)
7 Nov 2008CPOL2 min read 66.1K   4.2K   24  
Weather Using VB.NET and Yahoo RSS!
Imports Microsoft.VisualBasic
Imports System.Xml.Serialization
Partial Class YahooWeatherForecast
    Partial Class rssClass
        Partial Class channelClass
            Private _title As String
            ''' <summary>
            '''  The title of the feed, which includes the location city. For example "Yahoo! Weather - Sunnyvale, CA" 
            ''' </summary>
            <XmlElement()> _
            Public Property title() As String
                Get
                    Return _title
                End Get
                Set(ByVal value As String)
                    _title = value
                End Set
            End Property


            Private _link As String
            ''' <summary>
            '''  The URL for the Yahoo! Weather page of the forecast for this location. For example http://us.rd.yahoo.com/dailynews/rss/weather/ Sunnyvale__CA/ *http://xml.weather.yahoo.com/ forecast/94089_f.html
            ''' </summary>
            <XmlElement()> _
            Public Property link() As String
                Get
                    Return _link
                End Get
                Set(ByVal value As String)
                    _link = value
                End Set
            End Property

            Private _language As String
            ''' <summary>
            '''  The language of the weather forecast, for example, en-us for US English. 
            ''' </summary>
            <XmlElement()> _
            Public Property language() As String
                Get
                    Return _language
                End Get
                Set(ByVal value As String)
                    _language = value
                End Set
            End Property

            Private _description As String
            ''' <summary>
            '''  The overall description of the feed including the location, for example "Yahoo! Weather for Sunnyvale, CA" 
            ''' </summary>
            <XmlElement()> _
            Public Property description() As String
                Get
                    Return _description
                End Get
                Set(ByVal value As String)
                    _description = value
                End Set
            End Property

            Private _lastBuildDate As String
            ''' <summary>
            '''  The last time the feed was updated. The format is in the date format defined by RFC822 Section 5, for example Mon, 256 Sep 17:25:18 -0700.
            ''' </summary>
            <XmlElement()> _
            Public Property lastBuildDate() As String
                Get
                    Return _lastBuildDate
                End Get
                Set(ByVal value As String)
                    _lastBuildDate = value
                End Set
            End Property

            Private _ttl As String
            ''' <summary>
            '''  Time to Live; how long in minutes this feed should be cached. 
            ''' </summary>
            <XmlElement()> _
            Public Property ttl() As String
                Get
                    Return _ttl
                End Get
                Set(ByVal value As String)
                    _ttl = value
                End Set
            End Property

            Private _location As locationClass
            ''' <summary>
            '''  The location of this forecast.
            ''' </summary>
            <XmlElement()> _
            Public Property location() As locationClass
                Get
                    Return _location
                End Get
                Set(ByVal value As locationClass)
                    _location = value
                End Set
            End Property

            Private _units As unitsClass
            ''' <summary>
            '''  Units for various aspects of the forecast.
            ''' </summary>
            <XmlElement()> _
            Public Property units() As unitsClass
                Get
                    Return _units
                End Get
                Set(ByVal value As unitsClass)
                    _units = value
                End Set
            End Property

            Private _wind As windClass
            ''' <summary>
            '''  Forecast information about wind.
            ''' </summary>
            <XmlElement()> _
            Public Property wind() As windClass
                Get
                    Return _wind
                End Get
                Set(ByVal value As windClass)
                    _wind = value
                End Set
            End Property

            Private _atmosphere As atmosphereClass
            ''' <summary>
            '''  Forecast information about current atmospheric pressure, humidity, and visibility.
            ''' </summary>
            <XmlElement()> _
            Public Property atmosphere() As atmosphereClass
                Get
                    Return _atmosphere
                End Get
                Set(ByVal value As atmosphereClass)
                    _atmosphere = value
                End Set
            End Property

            Private _astronomy As astronomyClass
            ''' <summary>
            '''  Forecast information about current astronomical conditions.
            ''' </summary>
            <XmlElement()> _
            Public Property astronomy() As astronomyClass
                Get
                    Return _astronomy
                End Get
                Set(ByVal value As astronomyClass)
                    _astronomy = value
                End Set
            End Property

            Private _image As imageClass
            ''' <summary>
            '''  The image used to identify this feed
            ''' </summary>
            <XmlElement()> _
            Public Property image() As imageClass
                Get
                    Return _image
                End Get
                Set(ByVal value As imageClass)
                    _image = value
                End Set
            End Property

            Private _item As itemClass
            ''' <summary>
            '''  The local weather conditions and forecast for a specific location.
            ''' </summary>
            <XmlElement()> _
            Public Property item() As itemClass
                Get
                    Return _item
                End Get
                Set(ByVal value As itemClass)
                    _item = value
                End Set
            End Property
        End Class
    End Class
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) TeraSoft
Jordan Jordan
Nedal Ahmed Odeh
Software development
BS Computer
Deploma IT
Web: http://nedal.faithweb.com

Facebook: http://www.facebook.com/nedal.odeh

Please, do not forget vote
This is a Collaborative Group (No members)


Comments and Discussions