Merge pull request #1559 from jakedt/finishthejob

Finish removing the AJAX indexing support.
This commit is contained in:
Jake Moshenko 2016-06-20 13:42:05 -04:00 committed by GitHub
commit 22562b0156
2 changed files with 0 additions and 56 deletions

View file

@ -1,55 +0,0 @@
var system = require('system');
var url = system.args[1] || '';
var count = 0;
if(url.length > 0) {
var page = require('webpage').create();
page.open(url, function (status) {
try {
if (status == 'success') {
var delay;
var checker = (function() {
count++;
if (count > 100) {
console.log('Not Found');
phantom.exit();
return null;
}
var html = page.evaluate(function () {
var found = document.getElementsByTagName('html')[0].outerHTML || '';
if (window.__isLoading && !window.__isLoading()) {
return found;
}
if (found.indexOf('404 Not Found') > 0) {
return found;
}
return null;
});
if (html) {
if (html.indexOf('404 Not Found') > 0) {
console.log('Not Found');
phantom.exit();
return;
}
clearTimeout(delay);
console.log(html);
phantom.exit();
}
});
delay = setInterval(checker, 100);
} else {
console.log('Not Found');
phantom.exit();
}
} catch (e) {
console.log('Not Found');
phantom.exit();
}
});
} else {
phantom.exit();
}