Trans: Fixes to Google Scholar and Amazon
This commit is contained in:
parent
0a3c6c25ea
commit
4fe5d40f00
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"translatorID":"96b9f483-c44d-5784-cdad-ce21b984fe01",
|
||||
"translatorType":4,
|
||||
"label":"Amazon.com",
|
||||
"creator":"Sean Takats and Michael Berkowitz",
|
||||
"target":"^https?://(?:www\\.)?amazon",
|
||||
"minVersion":"1.0.0b4.r1",
|
||||
"maxVersion":"",
|
||||
"priority":100,
|
||||
"inRepository":true,
|
||||
"lastUpdated":"2010-06-10 02:55:00"
|
||||
"inRepository":"1",
|
||||
"translatorType":4,
|
||||
"lastUpdated":"2010-11-17 23:22:50"
|
||||
}
|
||||
|
||||
function detectWeb(doc, url) {
|
||||
|
@ -79,7 +79,7 @@ function doWeb(doc, url) {
|
|||
} else if (doc.location.href.match(/\/lm\//)) { // Show selector for Lists
|
||||
var xpath = '//span[@id="lm_asinlink95"]//a'
|
||||
} else { // Show selector for Search results
|
||||
var xpath = '//div[@class="productTitle"]/a | //a[span[@class="srTitle"]]';
|
||||
var xpath = '//div[@class="productTitle"]/a | //a[span[@class="srTitle"]] | //div[@class="title"]/a[@class="title"]';
|
||||
}
|
||||
var elmts = doc.evaluate(xpath, doc, nsResolver, XPathResult.ANY_TYPE, null);
|
||||
var elmt = elmts.iterateNext();
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
{
|
||||
"translatorID":"57a00950-f0d1-4b41-b6ba-44ff0fc30289",
|
||||
"translatorType":4,
|
||||
"label":"Google Scholar",
|
||||
"creator":"Simon Kornblith, Frank Bennett",
|
||||
"target":"http://scholar\\.google\\.(?:com|com?\\.[a-z]{2}|[a-z]{2}|co\\.[a-z]{2})/scholar(?:_case)*",
|
||||
"minVersion":"1.0.0b3.r1",
|
||||
"maxVersion":"",
|
||||
"priority":100,
|
||||
"inRepository":true,
|
||||
"lastUpdated":"2010-08-23 08:50:00"
|
||||
"inRepository":"1",
|
||||
"translatorType":4,
|
||||
"lastUpdated":"2010-11-18 00:17:10"
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Test pages
|
||||
*
|
||||
|
@ -70,8 +69,13 @@ function doWeb(doc, url) {
|
|||
if(!haveBibTexLinks) {
|
||||
url = url.replace (/hl\=[^&]*&?/, "");
|
||||
url = url.replace("scholar?", "scholar_setprefs?hl=en&scis=yes&scisf=4&submit=Save+Preferences&");
|
||||
haveBibTexLinks = true;
|
||||
var scisigDoc = Zotero.Utilities.retrieveDocument(url);
|
||||
var scisig = scisigDoc.evaluate('//input[@name="scisig"]',
|
||||
scisigDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
|
||||
url = url + "&scisig="+scisig.value;
|
||||
doc = Zotero.Utilities.retrieveDocument(url);
|
||||
haveBibTexLinks = true;
|
||||
Zotero.debug(url);
|
||||
}
|
||||
scrapeListing(doc);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user