Using XMLTextReader and DataSets to easily Data Mine Google News with very few lines of code.

by michael 7/10/2008 11:09:13 AM

Imports:
Imports System.Xml
Imports System.Data
 
Example Function:
Private Function ExtractGoogleNewsRSS(ByVal strSearchString As String) As Generic.List(Of NewsItem)
    Dim NewsItems As New List(Of NewsItem)
    Dim strSearchURL As String = String.Concat("http://news.google.com/news?hl=en&ned=us&q=", strSearchString, "&ie=UTF-8&output=rss")
    Using reader As XmlTextReader = New XmlTextReader(strSearchURL), _
          ds As New DataSet


        Dim dt As DataTable

        ds.ReadXml(reader)
        dt = ds.Tables(3)

        For Each row As DataRow In dt.Rows
            Dim itm As New NewsItem

            itm.Title = row("title")
            itm.PublishDate = row("pubdate")
            itm.Description = row("description")
            itm.URLString = row("link")

            NewsItems.Add(itm)
        Next
    End Using

    Return NewsItems
End Function

Private Class NewsItem
    Private _title As String
    Private _publishDate As Date
    Private _description As String
    Private _uRLString As String

    Public Property Title() As String
        Get
            Return _title
        End Get
        Set(ByVal value As String)
            _title = value
        End Set
    End Property

    Public Property PublishDate() As Date
        Get
            Return _publishDate
        End Get
        Set(ByVal value As Date)
            _publishDate = value
        End Set
    End Property

    Public Property Description() As String
        Get
            Return _description
        End Get
        Set(ByVal value As String)
            _description = value
        End Set
    End Property

    Public Property URLString() As String
        Get
            Return _uRLString
        End Get
        Set(ByVal value As String)
            _uRLString = value
        End Set
    End Property
End Class

You can easily load the Google News RSS data into an "XmlTextReader".  The "ReadXml" method of the "DataSet" converts the xml data into a "DataSet".  The "NewsItem" class is just an example data container.

Currently rated 2.9 by 14 people

  • Currently 2.857143/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

SignTool Error: Signtool requires CAPICOM version 2.1.0.1

by michael 3/12/2008 10:36:29 AM

I had uninstalled some CTP "Community Technology Preview" software.  The next thing I know I'm getting this "SignTool" error when trying to publish with ClickOnce in Visual Studio 2005.  It wasn't a hard fix.

  1. Download the latest CAPICOM "Platform SDK Redistributable" here.
  2. Run the downloaded "capicom_dc_sdk.msi" file.
  3. I had to register the DLL file.  Assuming the installation directory is the same just run the following command from the command prompt.

regsvr32 "C:\Program Files\Common Files\Microsoft Shared\CAPICOM\CapiCom.dll"

Hope this helps!

Currently rated 3.3 by 44 people

  • Currently 3.295455/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Great Silverlight 2 sessions at MIX 08

by michael 3/8/2008 1:39:06 PM

The MIX sessions videos are posted online here.

Currently rated 3.0 by 5 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Yeah.....Silverlight 2 Beta 1 Tools for Visual Studio 2008

by michael 3/5/2008 8:21:00 AM

The Silverlight 2 Beta 1 runtime and tools for visual studio were released today as part of MIX 08.

Download Link

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

So much to Grok: WCF and WF and LINQ and WPF... Oh My!

by michael 3/3/2008 10:31:00 PM

There are so many cool new things to learn in the .NET world.   It is hard to wrap my head around all of it.  I have had a chance to play with some of these new features (WCF, WF, LINQ, WPF), but I am no where near mastering any of them.  Well the best way to learn something is to dive right in. 

A simple but powerful example project that utilizes all of these new technologies would probably benefit the community greatly.  We need something to illustrate how these technologies can work together.

Will post updates on this if I can find the time to work on it.

Currently rated 3.0 by 21 people

  • Currently 3.047619/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Michael Johnson Michael Johnson
Developer and Technologist.

E-mail me Send mail

Pages

    Recent comments

    Categories

    None


    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2014

    Sign in