Display Weather Alerts From NOAA Using Atom (WPF Example)

stormsample1So since there is this impending storm (blizzard, snow storm, snowmageddon, snowpocalypse, snowzilla) “Nemo” hitting us here on the East coast within a few hours, I figured a good topic might be on weather alert data. There is a bunch of data available from the NOAA (National Oceanic and Atmospheric Administration) on their site. Data is available in several categories, including ForecastsWatch/warningsStorm Prediction Center Forecast Products, etc. In my very quick example I’m going to pick the “Watch / Warning” data for my region and display this using WPF for an easy visualization. Continue reading “Display Weather Alerts From NOAA Using Atom (WPF Example)”

Display Weather Alerts From NOAA Using Atom (WPF Example)

.Net’s System.ServiceModel.Syndication / RSS Feeds!

If you’re looking to work with RSS feeds, I suggest you checkout the .net ServiceModel.Syndication. Below is a quick example in .net 4 / VB:

 

Imports System.ServiceModel.Syndication

'In case you're using a proxy:
Dim wReq As HttpWebRequest
wReq = WebRequest.Create("http://yourRSSfeedURL")
wReq.Proxy = WebProxy.GetDefaultProxy
wReq.Proxy.Credentials = CredentialCache.DefaultCredentials
Dim xReader As XmlReader = XmlReader.Create(wReq.GetResponse.GetResponseStream)
'Create the feed from the xml loaded
Dim sFeed As SyndicationFeed = SyndicationFeed.Load(xReader)
'Loop through the results
For Each sItem As SyndicationItem In sFeed.Items
  Debug.WriteLine(sItem.Title.Text) 'Many other SyndicationItem properties available!
Next

I have compared this to other libraries and this by far is the cleanest / easiest way to pull in RSS Feeds. What are your thoughts?

.Net’s System.ServiceModel.Syndication / RSS Feeds!