Adapts Ancestry.com translator to new urls

This commit is contained in:
Elena Razlogova 2008-12-13 20:43:58 +00:00
parent 1589c5be2c
commit 6be11dc141

View file

@ -8,7 +8,7 @@
"maxVersion":"", "maxVersion":"",
"priority":100, "priority":100,
"inRepository":true, "inRepository":true,
"lastUpdated":"2008-03-24 02:15:00" "lastUpdated":"2008-12-13 21:00:00"
} }
function detectWeb(doc, url) { function detectWeb(doc, url) {
@ -42,7 +42,7 @@ function detectWeb(doc, url) {
indiv = 1; indiv = 1;
} }
checkURL = doc.location.href.replace("pf=", "").replace("&h=", ""); checkURL = doc.location.href.replace("pf=", "");
if(doc.location.href == checkURL && indiv == 1) { if(doc.location.href == checkURL && indiv == 1) {
return "bookSection"; return "bookSection";
} }
@ -122,12 +122,12 @@ function scrape(doc) {
if(m) { if(m) {
db = m[1]; db = m[1];
} }
var snapshotRe = /recid=([0-9]+)/; var snapshotRe = /\&h=([0-9]+)/;
var m = snapshotRe.exec(doc.location.href); var m = snapshotRe.exec(doc.location.href);
if(m) { if(m) {
snapshotURL = "http://search.ancestry.com/cgi-bin/sse.dll?db="+db+"&indiv=1&pf=1&recid="+m[1]; snapshotURL = "http://search.ancestry.com/cgi-bin/sse.dll?db="+db+"&indiv=1&pf=1&h="+m[1];
newItem.attachments.push({title:"Ancestry.com Snapshot", mimeType:"text/html", url:snapshotURL, snapshot:true}); newItem.attachments.push({title:"Ancestry.com Snapshot", mimeType:"text/html", url:snapshotURL, snapshot:true});
cleanURL = "http://search.ancestry.com/cgi-bin/sse.dll?indiv=1&db="+db+"&recid="+m[1]; cleanURL = "http://search.ancestry.com/cgi-bin/sse.dll?indiv=1&db="+db+"&h="+m[1];
newItem.url = cleanURL; newItem.url = cleanURL;
} }
@ -179,7 +179,7 @@ function scrape(doc) {
} }
function doWeb(doc, url) { function doWeb(doc, url) {
var resultsRegexp = /recid=/; var resultsRegexp = /&h=/;
if(resultsRegexp.test(url)) { if(resultsRegexp.test(url)) {
scrape(doc); scrape(doc);
} else { } else {