Fixes import of DOIs in proxied ACM.
This commit is contained in:
parent
499b5d98b3
commit
a46d6ebc7f
13
scrapers.sql
13
scrapers.sql
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
-- Set the following timestamp to the most recent scraper update date
|
||||
REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2008-03-03 21:00:00'));
|
||||
REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2008-03-04 16:00:00'));
|
||||
|
||||
REPLACE INTO translators VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '1.0.0b4.r1', '', '2007-06-21 20:00:00', '1', '100', '4', 'Amazon.com', 'Sean Takats', '^https?://(?:www\.)?amazon',
|
||||
'function detectWeb(doc, url) {
|
||||
|
@ -13212,7 +13212,7 @@ function doWeb(doc, url) {
|
|||
}
|
||||
}');
|
||||
|
||||
REPLACE INTO translators VALUES ('e78d20f7-488-4023-831-dfe39679f3f', '1.0.0b3.r1', '', '2008-02-19 22:00:00', '1', '100', '4', 'ACM', 'Simon Kornblith', 'https?://[^/]*portal\.acm\.org[^/]*/(?:results\.cfm|citation\.cfm)',
|
||||
REPLACE INTO translators VALUES ('e78d20f7-488-4023-831-dfe39679f3f', '1.0.0b3.r1', '', '2008-03-04 16:00:00', '1', '100', '4', 'ACM', 'Simon Kornblith', 'https?://[^/]*portal\.acm\.org[^/]*/(?:results\.cfm|citation\.cfm)',
|
||||
'function detectWeb(doc, url) {
|
||||
if(url.indexOf("/results.cfm") != -1) {
|
||||
var items = Zotero.Utilities.getItemArray(doc, doc, ''^https?://[^/]+/citation.cfm\\?[^#]+$'');
|
||||
|
@ -13278,7 +13278,14 @@ function scrape(doc) {
|
|||
while(keywordLink = keywordLinks.iterateNext()) {
|
||||
keywords.push(Zotero.Utilities.trimInternal(keywordLink.textContent.toLowerCase()));
|
||||
}
|
||||
var doi = doc.evaluate(''/html/body/div/table/tbody/tr[4]/td/table/tbody/tr/td/table/tbody/tr[3]/td[2][@class="small-text"]/a'', doc, null, XPathResult.ANY_TYPE, null).iterateNext().href.match(/org\/(.*)/)[1];
|
||||
var doi = "";
|
||||
var doiElmt = doc.evaluate(''/html/body/div/table/tbody/tr[4]/td/table/tbody/tr/td/table/tbody/tr[3]/td[2][@class="small-text"]/a'', doc, null, XPathResult.ANY_TYPE, null).iterateNext()
|
||||
if (doiElmt){
|
||||
var match = doiElmt.textContent.match(/org\/(.*)/);
|
||||
if (match){
|
||||
doi = match[1];
|
||||
}
|
||||
}
|
||||
|
||||
Zotero.Utilities.HTTP.doGet("http://portal.acm.org/"+m[1], function(text) {
|
||||
// split() may no longer be necessary
|
||||
|
|
Loading…
Reference in New Issue
Block a user