La seguente procedura permette di spedire al motore di ricerca Google la sitemap di un sito internet. Come esempio è stata presa in considerazione la sitemap di questo blog raggiungibile all’indirizzo https://blog.sorrentino.it/sitemap.xml :
Imports System.Net Dim uri As New Uri("http://www.google.com/webmasters/tools/ping?sitemap=https://blog.sorrentino.it/sitemap.xml") Dim data As String = "" If uri.Scheme = uri.UriSchemeHttp Then Dim request As HttpWebRequest = HttpWebRequest.Create(uri) request.Method = WebRequestMethods.Http.Post request.ContentLength = data.Length request.ContentType = "application/x-www-form-urlencoded" Dim writer As New StreamWriter(request.GetRequestStream) writer.Write(data) writer.Close() Dim oResponse As HttpWebResponse = request.GetResponse() Dim reader As New StreamReader(oResponse.GetResponseStream()) Dim tmp As String = reader.ReadToEnd() oResponse.Close() Response.Write(tmp) End If