{"id":253,"date":"2010-01-12T16:18:28","date_gmt":"2010-01-12T06:18:28","guid":{"rendered":"http:\/\/blog.peter-johnson.com.au\/?p=252"},"modified":"2010-01-12T16:18:28","modified_gmt":"2010-01-12T06:18:28","slug":"jscript-to-automatically-retrieve-check-web-page","status":"publish","type":"post","link":"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/","title":{"rendered":"JScript to automatically retrieve \/ check web page"},"content":{"rendered":"<p>Recently I discovered a problem with Manifold WMS where if the page wasn&#8217;t accessed for a while it would cause the w3wp.exe IIS worker thread to loop. Until I find out the underlying cause I&#8217;ve written the map_keepalive.wsf script below to automatically retrieve a web page and scheduled it to run every 5 minutes. I assume something gets spun down and the concurrent WMS requests cause a problem, the map_test.asp page that this script retrieves is just a default IMS page generated from within Manifold.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\n&lt;package&gt;\n  &lt;job id=&quot;js&quot;&gt;\n     &lt;script language=&quot;JScript&quot;&gt;\n\tvar finished = false;\n\tvar timeout = 0;\n\tvar timeoutSecs = 30;\n\tvar forAppending = 8;\n\tvar xmlhttp = WScript.CreateObject(&quot;MSXML2.XMLHTTP&quot;);\n\txmlhttp.open(&quot;GET&quot;, &quot;http:\/\/www.satsleuth.com&quot;, false);\n\txmlhttp.onreadystatechange = function() {\n\t\tif(xmlhttp.readyState == 4)\n\t\t\tfinished = true;\n\t}\n\ttry {\n\t\txmlhttp.Send(&quot;&quot;);\n\t} catch (e) {\n\t}\n\twhile ((!finished) &amp;&amp; (timeout &lt; timeoutSecs))\n\t{\n\t\ttimeout++;\n\t\tWScript.Sleep(1000);\n\t}\n\tvar msg = &quot;&quot;\n\tif (!finished)\n\t\tmsg = &quot;Timeout occurred&quot;;\n\telse if (xmlhttp.status != 200)\n\t\tmsg = &quot;Error retrieving map_test.asp, error code: &quot; + xmlhttp.status;\n\tif (msg != &quot;&quot;) {\n\t\tvar oFSO = WScript.CreateObject(&quot;Scripting.FileSystemObject&quot;);\n\t\tvar oFile = oFSO.OpenTextFile(&quot;map_keepalive.log&quot;, forAppending, true);\n\t\tvar dt = new Date();\n\t\toFile.WriteLine(dt.toLocaleString() + &quot;: &quot; + msg);\n\t\toFile.Close();\n\t}\n      &lt;\/script&gt;\n   &lt;\/job&gt;\n&lt;\/package&gt;\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Recently I discovered a problem with Manifold WMS where if the page wasn&#8217;t accessed for a while it would cause the w3wp.exe IIS worker thread to loop. Until I find out the underlying cause I&#8217;ve written the map_keepalive.wsf script below to automatically retrieve a web page and scheduled it to run every 5 minutes. I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,8],"tags":[],"class_list":["post-253","post","type-post","status-publish","format-standard","hentry","category-gps","category-programming"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\r\n<title>JScript to automatically retrieve \/ check web page - 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\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"JScript to automatically retrieve \/ check web page - Peter Johnson&#039;s Blog\" \/>\r\n<meta property=\"og:description\" content=\"Recently I discovered a problem with Manifold WMS where if the page wasn&#8217;t accessed for a while it would cause the w3wp.exe IIS worker thread to loop. Until I find out the underlying cause I&#8217;ve written the map_keepalive.wsf script below to automatically retrieve a web page and scheduled it to run every 5 minutes. I [&hellip;]\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/\" \/>\r\n<meta property=\"og:site_name\" content=\"Peter Johnson&#039;s Blog\" \/>\r\n<meta property=\"article:published_time\" content=\"2010-01-12T06:18:28+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=\"1 minute\" \/>\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\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/\"},\"author\":{\"name\":\"Peter Johnson\",\"@id\":\"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/4c77aa7d5243430f95831ecb7277546c\"},\"headline\":\"JScript to automatically retrieve \/ check web page\",\"datePublished\":\"2010-01-12T06:18:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/\"},\"wordCount\":244,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/4c77aa7d5243430f95831ecb7277546c\"},\"articleSection\":[\"GPS \/ GIS\",\"Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/\",\"url\":\"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/\",\"name\":\"JScript to automatically retrieve \/ check web page - Peter Johnson&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.peter-johnson.com.au\/#website\"},\"datePublished\":\"2010-01-12T06:18:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.peter-johnson.com.au\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JScript to automatically retrieve \/ check web page\"}]},{\"@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":"JScript to automatically retrieve \/ check web page - 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\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/","og_locale":"en_US","og_type":"article","og_title":"JScript to automatically retrieve \/ check web page - Peter Johnson&#039;s Blog","og_description":"Recently I discovered a problem with Manifold WMS where if the page wasn&#8217;t accessed for a while it would cause the w3wp.exe IIS worker thread to loop. Until I find out the underlying cause I&#8217;ve written the map_keepalive.wsf script below to automatically retrieve a web page and scheduled it to run every 5 minutes. I [&hellip;]","og_url":"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/","og_site_name":"Peter Johnson&#039;s Blog","article_published_time":"2010-01-12T06:18:28+00:00","author":"Peter Johnson","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Peter Johnson","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/#article","isPartOf":{"@id":"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/"},"author":{"name":"Peter Johnson","@id":"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/4c77aa7d5243430f95831ecb7277546c"},"headline":"JScript to automatically retrieve \/ check web page","datePublished":"2010-01-12T06:18:28+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/"},"wordCount":244,"commentCount":0,"publisher":{"@id":"https:\/\/blog.peter-johnson.com.au\/#\/schema\/person\/4c77aa7d5243430f95831ecb7277546c"},"articleSection":["GPS \/ GIS","Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/","url":"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/","name":"JScript to automatically retrieve \/ check web page - Peter Johnson&#039;s Blog","isPartOf":{"@id":"https:\/\/blog.peter-johnson.com.au\/#website"},"datePublished":"2010-01-12T06:18:28+00:00","breadcrumb":{"@id":"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.peter-johnson.com.au\/index.php\/2010\/01\/12\/jscript-to-automatically-retrieve-check-web-page\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.peter-johnson.com.au\/"},{"@type":"ListItem","position":2,"name":"JScript to automatically retrieve \/ check web page"}]},{"@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\/253","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=253"}],"version-history":[{"count":0,"href":"https:\/\/blog.peter-johnson.com.au\/index.php\/wp-json\/wp\/v2\/posts\/253\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.peter-johnson.com.au\/index.php\/wp-json\/wp\/v2\/media?parent=253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.peter-johnson.com.au\/index.php\/wp-json\/wp\/v2\/categories?post=253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.peter-johnson.com.au\/index.php\/wp-json\/wp\/v2\/tags?post=253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}