{ "translatorID":"d1bf1c29-4432-4ada-8893-2e29fc88fd9e", "translatorType":4, "label":"washingtonpost.com", "creator":"Simon Kornblith", "target":"^http://www\\.washingtonpost\\.com/", "minVersion":"1.0.0b3.r1", "maxVersion":"", "priority":100, "inRepository":true, "lastUpdated":"2007-06-21 20:10:00" } function detectWeb(doc, url) { var namespace = doc.documentElement.namespaceURI; var nsResolver = namespace ? function(prefix) { if (prefix == 'x') return namespace; else return null; } : null; // don't say we can scrape when we can't; make sure user is logged in var signedIn = doc.evaluate('//a[text() = "Sign out" or text() = "Sign Out"]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext(); if(!signedIn) { return; } var articleRegexp = /http:\/\/www\.washingtonpost\.com\/wp-dyn\/content\/article\/[0-9]+\/[0-9]+\/[0-9]+\/[^\/]+\.html/ if(articleRegexp.test(url)) { return "newspaperArticle"; } else { var aTags = doc.getElementsByTagName("a"); for(var i=0; i