Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim listToPing As New ArrayList
Dim pingURL As String = ""
Dim blogURL As String = ""
Dim blogName As String = ""
With listToPing
.Add("http://rpc.technorati.com/rpc/ping")
.Add("http://api.feedster.com/ping")
.Add("http://ping.feedburner.com")
.Add("http://blog.goo.ne.jp/XMLRPC")
.Add("http://ping.blo.gs/")
.Add("http://ping.bloggers.jp/rpc/")
.Add("http://ping.blogmura.jp/rpc/")
.Add("http://ping.cocolog-nifty.com/xmlrpc")
.Add("http://ping.syndic8.com/xmlrpc.php")
.Add("http://rpc.blogbuzzmachine.com/RPC2")
.Add("http://rpc.blogrolling.com/pinger/")
End With
For i As Integer = 0 To listToPing.Count - 1
Try
pingURL = listToPing.Item(i).ToString
Dim technoratiPing As Net.HttpWebRequest = CType(Net.WebRequest.Create(pingURL), Net.HttpWebRequest)
technoratiPing.Method = "POST"
technoratiPing.ContentType = "text/xml"
Dim streamPingRequest As IO.Stream = CType(technoratiPing.GetRequestStream, IO.Stream)
Dim xmlPing As Xml.XmlWriter = New Xml.XmlTextWriter(streamPingRequest, System.Text.Encoding.UTF8)
xmlPing.WriteStartDocument()
xmlPing.WriteStartElement("methodCall")
xmlPing.WriteElementString("methodName", "weblogUpdates.ping")
xmlPing.WriteStartElement("params")
xmlPing.WriteStartElement("param")
xmlPing.WriteElementString("value", blogName)
xmlPing.WriteEndElement()
xmlPing.WriteStartElement("param")
xmlPing.WriteElementString("value", blogURL)
xmlPing.WriteEndElement()
xmlPing.WriteEndElement()
xmlPing.WriteEndElement()
xmlPing.Close()
Dim technoratiPingResponse As Net.HttpWebResponse = CType(technoratiPing.GetResponse, Net.HttpWebResponse)
Dim streamPingResponse As IO.StreamReader = New IO.StreamReader(technoratiPingResponse.GetResponseStream)
Dim strResult As String = streamPingResponse.ReadToEnd
streamPingResponse.Close()
technoratiPingResponse.Close()
Catch ex As Exception
'Add code here to flag a service as broken
End Try
Next
End Sub