Incorporate blog roll

Let’s say you have a WordPress blog at another domain and you want to show it on another domain.

Well, you’re better off using a more standard way of incorporating a WordPress blog into your website (just google around), but if you need to do something more custom, here’s a possibility.

Here’s some pseudo code for a .Net application – you get the idea.  One thing to keep in mind is that XMLDocument is not serializable, so if you want to save it in a session state or do something else, you will need to work around it.

            Dim xmlReader As XmlReader = xmlReader.Create("your website blog url goes here/feed/rss")
            Dim xmlDocument As XmlDocument = New XmlDocument
            Dim xmlNameSpaceManager As XmlNamespaceManager = New XmlNamespaceManager(xmlDocument.NameTable)
            xmlNameSpaceManager.AddNamespace("content", "")
            xmlNameSpaceManager.AddNamespace("wfw", "")
            xmlNameSpaceManager.AddNamespace("dc", "")
            xmlNameSpaceManager.AddNamespace("atom", "")
            xmlNameSpaceManager.AddNamespace("sy", "")
            xmlNameSpaceManager.AddNamespace("slash", "")
            Dim items As XmlNodeList = xmlDocument.SelectNodes("/rss/channel/item")
            For Each item As XmlNode In items
                Dim bloglink As String = item("link").InnerText
                Dim blogTitle As String = item("title").InnerText
                Dim pubDate As String = item("pubDate").InnerText
                Dim blogAuthor As String = item("dc:creator").InnerText
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: