Reading the dl.bukkit.org XML

Discussion in 'Bukkit Help' started by xTom, Jul 16, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    xTom

    I'm using VB.net to create a server wrapper, and I'm trying to get the download URL of each channel from this XML. This is what I have so far:
    Code:
            Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://dl.bukkit.org/api/1.0/downloads/projects/bukkit/")
            Dim response As System.Net.HttpWebResponse = request.GetResponse()
     
            ' Check if the response is OK (status code 200)
            If response.StatusCode = System.Net.HttpStatusCode.OK Then
     
                ' Parse the contents from the response to a stream object
                Dim stream As System.IO.Stream = response.GetResponseStream()
                ' Create a reader for the stream object
                Dim reader As New System.IO.StreamReader(stream)
                ' Read from the stream object using the reader, put the contents in a string
                Dim contents As String = reader.ReadToEnd()
                ' Create a new, empty XML document
                Dim document As New System.Xml.XmlDocument()
     
                ' Load the contents into the XML document
                document.LoadXml(contents)
     
            Else
                ' If the call to the remote site fails
                ' See the codes in the System.Net.HttpStatusCode enumerator
     
                Throw New Exception("Could not retrieve document from the URL, response code: " & response.StatusCode)
     
            End If
    I think I have the XML loaded into memory but I have not a clue on how to get the specific node data.
    Sorry if this is the wrong board and thanks for any help!

    -Tom
     
  2. Offline

    JWhy

  3. Offline

    xTom

Thread Status:
Not open for further replies.

Share This Page