Skip to content

Instantly share code, notes, and snippets.

Last active December 22, 2015 01:59
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="">
<author>Akhmad Fathonih</author>
<description>URL 404 check</description>
USE '' AS mytable;select * from mytable where url = '']]></sampleQuery>
<select itemPath="" produces="XML">
<key id="url" type="xs:string" required="true" paramType="variable" />
var resp =;
var status = parseInt(resp.status);
var max_redirects = 1;
var redirects = 0;
while(status==301 || status==302 && redirects < max_redirects) {
resp =;
status = parseInt(resp.status);
response.object = {found: status==200?1:0/*, status: status, redirects: redirects, resp: resp*/ };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment