{"id":215,"date":"2009-10-27T17:49:08","date_gmt":"2009-10-27T07:49:08","guid":{"rendered":"http:\/\/blog.peter-johnson.com.au\/?p=215"},"modified":"2022-03-20T00:15:13","modified_gmt":"2022-03-19T13:15:13","slug":"asp-site-map-generator","status":"publish","type":"post","link":"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/","title":{"rendered":"ASP site map generator"},"content":{"rendered":"<p>This is a simple ASP site map generator that I wrote some time ago using VBScript, it&#8217;s for a human-readable sitemap not the XML sitemaps used by Google and other search engines. It uses the Scripting.FileSystemObject to scan the same directory level that the ASP is placed at and returns a link to any htm or html pages found along with the last modification time and the title of the page. It was fairly quickly written so the parsing used for the title tag is just to suit the format I was using and it might need some other tweaking to suit your own site.<\/p>\n<p>Because I don&#8217;t actively use the script anymore I haven&#8217;t updated to XHTML 1.0 Strict so on the W3C Markup Validation Service it will only pass as HTML 4.01 Transitional. Currently presentation elements are embedded in the HTML rather than a CSS style sheet. Here is the main logic for the page:<\/p>\n<pre><pre class=\"brush: vb; title: ; notranslate\" title=\"\">\n&amp;amp;lt;table border=&quot;1&quot;&amp;amp;gt;\n&amp;amp;lt;tr&amp;amp;gt;&amp;amp;lt;td&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;Page name&amp;amp;lt;\/b&amp;amp;gt;&amp;amp;lt;\/td&amp;amp;gt;&amp;amp;lt;td ALIGN=&quot;RIGHT&quot;&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;Modified&amp;amp;lt;\/b&amp;amp;gt;&amp;amp;lt;\/td&amp;amp;gt;&amp;amp;lt;td&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;Title&amp;amp;lt;\/b&amp;amp;gt;&amp;amp;lt;\/td&amp;amp;gt;&amp;amp;lt;\/tr&amp;amp;gt;\n&amp;amp;lt;%\n\tDim objFSO, objFolder, objFiles, objFile, strFile, Title, CurLine, LCaseLine, TitlePos, PageCount, FontColour\n\n\tPrivate Sub GetTitle(FileName)\n\t\tDim fso, file, strPhysicalPath\n\n\t\tTitle = &quot;&quot;\n\t\tset fso = Server.Createobject(&quot;Scripting.FileSystemObject&quot;)\n\t\tstrPhysicalPath = Server.MapPath(FileName)\n\t\tset file = fso.opentextfile(strPhysicalPath, 1)\n\t\tdo until file.AtEndOfStream or Len(Title) &amp;amp;gt; 0\n\t\t\tCurLine = file.ReadLine\n\t\t\tLCaseLine = LCase(CurLine)\n\t\t\tTitlePos = InStr(LCaseLine, &quot;&amp;amp;lt;title&amp;amp;gt;&quot;)\n\t\t\tif TitlePos then\n\t\t\t\tTitle = Right(CurLine, Len(CurLine) - TitlePos - 6)\n\t\t\t\tTitle = Left(Title, InStr(LCaseLine, &quot;&amp;amp;lt;\/title&amp;amp;gt;&quot;) - 8 )\n\t\t\tend if\n\t\tloop\n\t\tfile.close\n\tEnd Sub\n\n\tSet objFSO = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)\n\tSet objFolder = objFSO.GetFolder(Server.MapPath(&quot;.&quot;))\n\tSet objFiles = objFolder.Files\n\tPageCount = 0\n\tFor Each objFile in objFiles\n\t\tstrFile = LCase(objFile.Name)\n\t\tIf Right(strFile, 4) = &quot;.htm&quot; or Right(strFile, 5) = &quot;.html&quot;  then\n\t\t\tGetTitle(objFile.Name)\n\t\t\tif Len(Title) &amp;amp;gt; 0 then\n\t\t\t\tPageCount = PageCount + 1\n\t\t\t\tif objFile.DateLastModified &amp;amp;gt;= Date - 7 then\n\t\t\t\t\tFontColour = &quot;&amp;amp;lt;font color=&quot;&quot;#FF0000&quot;&quot;&amp;amp;gt;&quot;\n\t\t\t\telse\n\t\t\t\t\tFontColour = &quot;&amp;amp;lt;font color=&quot;&quot;#000000&quot;&quot;&amp;amp;gt;&quot;\n\t\t\t\tend if\n\t\t\t\tResponse.Write(&quot;&amp;amp;lt;tr&amp;amp;gt;&amp;amp;lt;td&amp;amp;gt;&amp;amp;lt;a href=&quot;&quot;&quot; &amp;amp;amp; strFile &amp;amp;amp; &quot;&quot;&quot;&amp;amp;gt;&quot; &amp;amp;amp; _\n\t\t\t\t\tstrFile &amp;amp;amp; &quot;&amp;amp;lt;\/a&amp;amp;gt;&amp;amp;lt;\/td&amp;amp;gt;&amp;amp;lt;td align=&quot;&quot;RIGHT&quot;&quot;&amp;amp;gt;&quot; &amp;amp;amp; _\n\t\t\t\t\tFontColour &amp;amp;amp; DateValue(objFile.DateLastModified) &amp;amp;amp; &quot;&amp;amp;lt;\/font&amp;amp;gt;&quot; &amp;amp;amp; _\n\t\t\t\t\t&quot;&amp;amp;lt;\/td&amp;amp;gt;&amp;amp;lt;td&amp;amp;gt;&quot; &amp;amp;amp; Title &amp;amp;amp; &quot;&amp;amp;lt;\/td&amp;amp;gt;&amp;amp;lt;\/tr&amp;amp;gt;&quot;)\n\t\t\tend if\n\t\tend if\n\tnext\n\tResponse.Write(&quot;&amp;amp;lt;tr&amp;amp;gt;&amp;amp;lt;td&amp;amp;gt;&amp;amp;amp;nbsp;&amp;amp;lt;\/td&amp;amp;gt;&amp;amp;lt;td&amp;amp;gt;&amp;amp;amp;nbsp;&amp;amp;lt;\/td&amp;amp;gt;&amp;amp;lt;td&amp;amp;gt;&amp;amp;lt;b&amp;amp;gt;Total pages: &quot; &amp;amp;amp; PageCount &amp;amp;amp; &quot;&amp;amp;lt;\/b&amp;amp;gt;&amp;amp;lt;\/td&amp;amp;gt;&amp;amp;lt;\/tr&amp;amp;gt;&quot;)\n%&amp;amp;gt;\n&amp;amp;lt;\/table&amp;amp;gt;\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is a simple ASP site map generator that I wrote some time ago using VBScript, it&#8217;s for a human-readable sitemap not the XML sitemaps used by Google and other search engines. It uses the Scripting.FileSystemObject to scan the same directory level that the ASP is placed at and returns a link to any htm [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-215","post","type-post","status-publish","format-standard","hentry","category-programming"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\r\n<title>ASP site map generator - Peter Johnson&#039;s Blog<\/title>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"ASP site map generator - Peter Johnson&#039;s Blog\" \/>\r\n<meta property=\"og:description\" content=\"This is a simple ASP site map generator that I wrote some time ago using VBScript, it&#8217;s for a human-readable sitemap not the XML sitemaps used by Google and other search engines. It uses the Scripting.FileSystemObject to scan the same directory level that the ASP is placed at and returns a link to any htm [&hellip;]\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/\" \/>\r\n<meta property=\"og:site_name\" content=\"Peter Johnson&#039;s Blog\" \/>\r\n<meta property=\"article:published_time\" content=\"2009-10-27T07:49:08+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2022-03-19T13:15:13+00:00\" \/>\r\n<meta name=\"author\" content=\"Peter Johnson\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Peter Johnson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/\"},\"author\":{\"name\":\"Peter Johnson\",\"@id\":\"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/4c77aa7d5243430f95831ecb7277546c\"},\"headline\":\"ASP site map generator\",\"datePublished\":\"2009-10-27T07:49:08+00:00\",\"dateModified\":\"2022-03-19T13:15:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/\"},\"wordCount\":164,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/4c77aa7d5243430f95831ecb7277546c\"},\"articleSection\":[\"Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/\",\"url\":\"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/\",\"name\":\"ASP site map generator - Peter Johnson&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.peter-johnson.com.au\/#website\"},\"datePublished\":\"2009-10-27T07:49:08+00:00\",\"dateModified\":\"2022-03-19T13:15:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.peter-johnson.com.au\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ASP site map generator\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.peter-johnson.com.au\/#website\",\"url\":\"https:\/\/blog.peter-johnson.com.au\/\",\"name\":\"Peter Johnson&#039;s Blog\",\"description\":\"Hobart, Tasmania Software Development\",\"publisher\":{\"@id\":\"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/4c77aa7d5243430f95831ecb7277546c\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.peter-johnson.com.au\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/4c77aa7d5243430f95831ecb7277546c\",\"name\":\"Peter Johnson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/blog.peter-johnson.com.au\/wp-content\/uploads\/2022\/03\/168849_1786067253024_5579222_n.jpg\",\"contentUrl\":\"https:\/\/blog.peter-johnson.com.au\/wp-content\/uploads\/2022\/03\/168849_1786067253024_5579222_n.jpg\",\"width\":160,\"height\":120,\"caption\":\"Peter Johnson\"},\"logo\":{\"@id\":\"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/blog.peter-johnson.com.au\"],\"url\":\"https:\/\/blog.peter-johnson.com.au\/index.php\/author\/peterj\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ASP site map generator - Peter Johnson&#039;s Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/","og_locale":"en_US","og_type":"article","og_title":"ASP site map generator - Peter Johnson&#039;s Blog","og_description":"This is a simple ASP site map generator that I wrote some time ago using VBScript, it&#8217;s for a human-readable sitemap not the XML sitemaps used by Google and other search engines. It uses the Scripting.FileSystemObject to scan the same directory level that the ASP is placed at and returns a link to any htm [&hellip;]","og_url":"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/","og_site_name":"Peter Johnson&#039;s Blog","article_published_time":"2009-10-27T07:49:08+00:00","article_modified_time":"2022-03-19T13:15:13+00:00","author":"Peter Johnson","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Peter Johnson","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/#article","isPartOf":{"@id":"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/"},"author":{"name":"Peter Johnson","@id":"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/4c77aa7d5243430f95831ecb7277546c"},"headline":"ASP site map generator","datePublished":"2009-10-27T07:49:08+00:00","dateModified":"2022-03-19T13:15:13+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/"},"wordCount":164,"commentCount":0,"publisher":{"@id":"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/4c77aa7d5243430f95831ecb7277546c"},"articleSection":["Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/","url":"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/","name":"ASP site map generator - Peter Johnson&#039;s Blog","isPartOf":{"@id":"https:\/\/blog.peter-johnson.com.au\/#website"},"datePublished":"2009-10-27T07:49:08+00:00","dateModified":"2022-03-19T13:15:13+00:00","breadcrumb":{"@id":"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.peter-johnson.com.au\/index.php\/2009\/10\/27\/asp-site-map-generator\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.peter-johnson.com.au\/"},{"@type":"ListItem","position":2,"name":"ASP site map generator"}]},{"@type":"WebSite","@id":"https:\/\/blog.peter-johnson.com.au\/#website","url":"https:\/\/blog.peter-johnson.com.au\/","name":"Peter Johnson&#039;s Blog","description":"Hobart, Tasmania Software Development","publisher":{"@id":"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/4c77aa7d5243430f95831ecb7277546c"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.peter-johnson.com.au\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/4c77aa7d5243430f95831ecb7277546c","name":"Peter Johnson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/image\/","url":"https:\/\/blog.peter-johnson.com.au\/wp-content\/uploads\/2022\/03\/168849_1786067253024_5579222_n.jpg","contentUrl":"https:\/\/blog.peter-johnson.com.au\/wp-content\/uploads\/2022\/03\/168849_1786067253024_5579222_n.jpg","width":160,"height":120,"caption":"Peter Johnson"},"logo":{"@id":"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/blog.peter-johnson.com.au"],"url":"https:\/\/blog.peter-johnson.com.au\/index.php\/author\/peterj\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.peter-johnson.com.au\/index.php\/wp-json\/wp\/v2\/posts\/215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.peter-johnson.com.au\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.peter-johnson.com.au\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.peter-johnson.com.au\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.peter-johnson.com.au\/index.php\/wp-json\/wp\/v2\/comments?post=215"}],"version-history":[{"count":2,"href":"https:\/\/blog.peter-johnson.com.au\/index.php\/wp-json\/wp\/v2\/posts\/215\/revisions"}],"predecessor-version":[{"id":399,"href":"https:\/\/blog.peter-johnson.com.au\/index.php\/wp-json\/wp\/v2\/posts\/215\/revisions\/399"}],"wp:attachment":[{"href":"https:\/\/blog.peter-johnson.com.au\/index.php\/wp-json\/wp\/v2\/media?parent=215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.peter-johnson.com.au\/index.php\/wp-json\/wp\/v2\/categories?post=215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.peter-johnson.com.au\/index.php\/wp-json\/wp\/v2\/tags?post=215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}