Google webmaster tools – SiteMap generator

Download source code at: Google Site Map Console Application Source

To make your web site visible to Google crawler you have to update a site map to Google. Site map file  is basically an xml file which contains the list of specific url which crawler is supposed to visit

An example of an sitemap file contain could be

<?xml version=”1.0″?>
<urlset xmlns=”http://www.google.com/schemas/sitemap/0.84″&gt;

<url>

<loc>

http://community.vuscode.com/blogs/malovicn/default.aspx

</loc>

    <lastmod>2006-10-10T08:08:22+00:00</lastmod>

    <changefreq>always</changefreq>

    <priority>0.8</priority>

</url>

<url>

<loc>

http://community.vuscode.com/default.aspx

</loc>

    <lastmod>2006-10-10T08:08:22+00:00</lastmod>

    <changefreq>always</changefreq>

    <priority>0.8</priority>
</url>

</urlset>

To create a site map file you could use a simple console application like this one

using System.Xml;

using System;

namespace ConsoleApplication1

{

    class Program

    {

               

        static void Main(string[] args)

        {

            using (XmlTextWriter xmlWriter = new XmlTextWriter(@”D:Sitemap.xml”,null))

            {

                xmlWriter.Formatting = Formatting.Indented;

                xmlWriter.WriteStartDocument();

                xmlWriter.WriteStartElement(“urlset”);

                xmlWriter.WriteAttributeString(“xmlns”, http://www.google.com/schemas/sitemap/0.84&#8221;);

                // adding of first site map item

                WriteSiteMapItem(xmlWriter, @”http://community.vuscode.com/blogs/malovicn/default.aspx&#8221;);

                // adding of second site map item

                WriteSiteMapItem(xmlWriter, @”http://community.vuscode.com/default.aspx&#8221;);

                xmlWriter.WriteEndElement();

                xmlWriter.WriteEndDocument();

                xmlWriter.Flush();

            }

        }

        private static void WriteSiteMapItem(XmlTextWriter xmlWriter,string siteMapItemUrl)

        {

            string now = string.Format(“{0}{1}”, TimeZone.CurrentTimeZone.ToUniversalTime(DateTime.Now).ToString(“s”), “+00:00”);

            xmlWriter.WriteStartElement(“url”);

            xmlWriter.WriteElementString(“loc”, siteMapItemUrl);

            xmlWriter.WriteElementString(“lastmod”, now);

            xmlWriter.WriteElementString(“changefreq”, “always”);

            xmlWriter.WriteElementString(“priority”, “0.8”);

            xmlWriter.WriteEndElement();

        }

    }

}

Resulting site map is then to be uploaded through http://www.google.com/webmasters/sitemaps/  Google web site dedicated to web master support.

You have to:

a) login with your Google account,

b) add your site url,

c) verify that you are the owner by creating an empty html file with given specific name,

d) create and upload site map file with some generator like the one I’ve exampled

20.10.2006

And for all blogs hosted on CS Mr Dan Bartel made a nice add in which does this automatically

http://communityserver.org/files/folders/add-ons/entry547382.aspx

Advertisements

Posted on October 10, 2006, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: