www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 6f70db1a7fe582d272149b26ce6541f23efb223a
parent 8242acd067b91353a56c355803dbe283094ee293
Author: Avram Lyon <ajlyon@gmail.com>
Date:   Tue, 15 Feb 2011 18:23:24 +0000

Trans: Fix super-fragile but simple PEP translator


Diffstat:
Mtranslators/PEP Web.js | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/translators/PEP Web.js b/translators/PEP Web.js @@ -3,12 +3,12 @@ "translatorType":4, "label":"PEP Web", "creator":"Akilesh Ayyar", - "target":"^http?://www.pep-web.org", + "target":"^https?://www\\.pep-web\\.org", "minVersion":"1.0.0b3.r1", "maxVersion":"", "priority":100, "inRepository":false, - "lastUpdated":"2009-10-02 04:50:00" + "lastUpdated":"2011-02-15 04:50:00" } //Only works for journal articles, and only for single entries. @@ -36,9 +36,9 @@ function scrape(doc, url) { var newItem = new Zotero.Item("journalArticle"); newItem.url = doc.location.href; - var xPathString = "/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/table/tbody/tr/td[1]/span[@id='maincite']"; + var xPathString = "//span[@id='maincite']"; - var xPathString2 = "/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/div/p[3]/a"; + var xPathString2 = '//p[@class="title"]/a'; var myXPathObject = doc.evaluate(xPathString, doc, nsResolver, XPathResult.ANY_TYPE, null); var myXPathObject2 = doc.evaluate(xPathString2, doc, nsResolver, XPathResult.ANY_TYPE, null); @@ -112,4 +112,4 @@ function doWeb(doc, url) { Zotero.Utilities.processDocuments(articles, scrape, function(){Zotero.done();}); Zotero.wait(); -} -\ No newline at end of file +}