KnowlegeZone.com, Share knowledge Gain knowledge
     

Home > ASP : Bestbuy Remix API (Using ASP.NET)

Article By: Saqib Khan   Date: 5/30/2009

Bestbuy Remix API (Using ASP.NET)

Easily Read Bestbuy Remix API data using ASP.NET

 

Imports System.Data
Imports System.Xml
Imports System.Net
Imports System.IO

Partial Class BestBuy_Default
    Inherits System.Web.UI.Page

 


    Private Sub ReadXml()

        Dim iRequest As HttpWebRequest = HttpWebRequest.Create(http://api.remix.bestbuy.com/v1/products(manufacturer='canon')?&apiKey=xxxx)


        Dim iResponse As HttpWebResponse = iRequest.GetResponse

        Dim reader As New StreamReader(iResponse.GetResponseStream)


        Dim iDoc As New XmlDocument
        iDoc.LoadXml(reader.ReadToEnd)

        Dim ProductNode As XmlNodeList
        ProductNode = iDoc.GetElementsByTagName("product")

        For Each Item As XmlNode In ProductNode

            Dim ChildNodes As XmlNodeList = Item.ChildNodes

            For Each Item2 As XmlNode In ChildNodes

                xxx.Text += "<b>" & Item2.Name & " : </b> " & Item2.InnerText & "<br>"

                If Item2.Name = "image" Then
                    xxx.Text += "<img src='" & Item2.InnerText & "' />"
                End If


            Next
            xxx.Text += "<hr>"
        Next

 

 


    End Sub

 


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Call Me.ReadXml()

    End Sub

End Class
 


Share |

No comments posted.
Post Comment or Solution   OR   Sign in using Google/Aol/Yahoo/Msn/OpenID
Your Name:  
Your Email:  
Comments:
 
Please Verify:
(Type Answer)