Skip to content
Permalink
Browse files

Target tweaks (#1211)

Closes #789
The priority issue is separate, but we may also have done that since.
* Always start target with ^, when appropriate
* Start target always with ^https?, when approriate
* Don't escape slash in target regexp
* Escape periods in target when needed
Found by
$ grep '"target": .*[^\]\.\w' *.js
* Simplify groups in regexp of target
Remove all instances of non-capturing parentheses and replace with capturing parentheses. This doesn't matter in target regexp and makes it a bit cleaner.
  • Loading branch information...
zuphilip authored and adam3smith committed Jan 8, 2017
1 parent cfc4291 commit ed21c7bdcccf91e076af4f564722d47893184dca
Showing with 179 additions and 177 deletions.
  1. +2 −2 ACS Publications.js
  2. +1 −1 AIP.js
  3. +1 −1 AMS MathSciNet.js
  4. +1 −1 APN.ru.js
  5. +1 −1 APS-Physics.js
  6. +2 −2 ARTFL Encyclopedie.js
  7. +1 −1 ARTstor.js
  8. +1 −1 Ab Imperio.js
  9. +1 −1 Airiti.js
  10. +1 −1 Alexander Street Press.js
  11. +1 −1 AlterNet.js
  12. +1 −1 Aluka.js
  13. +1 −1 Amazon.js
  14. +2 −2 Annual Reviews.js
  15. +1 −1 Atypon Journals.js
  16. +1 −1 AustLII and NZLII.js
  17. +1 −1 BAILII.js
  18. +1 −1 BBC.js
  19. +1 −1 BOCC.js
  20. +2 −2 BOFiP-Impots.js
  21. +1 −1 Bezneng Gajit.js
  22. +2 −2 BioMed Central.js
  23. +1 −1 CCfr (BnF).js
  24. +2 −2 CNKI.js
  25. +1 −1 CanLII.js
  26. +2 −2 CiteULike.js
  27. +1 −1 Clinical Key.js
  28. +2 −2 Code4Lib Journal.js
  29. +1 −1 Copernicus.js
  30. +2 −2 DAI-Zenon.js
  31. +1 −1 Delpher.js
  32. +2 −2 Douban.js
  33. +2 −2 DrugBank.ca.js
  34. +1 −1 ERIC.js
  35. +1 −1 Engineering Village.js
  36. +1 −1 Epicurious.js
  37. +1 −1 Factiva.js
  38. +1 −1 Flickr.js
  39. +2 −2 Galegroup.js
  40. +2 −2 Gmail.js
  41. +2 −2 Google Books.js
  42. +1 −1 Google Patents.js
  43. +1 −1 HeinOnline.js
  44. +2 −2 IEEE Xplore.js
  45. +2 −2 Informationssystem Medienpaedagogik.js
  46. +2 −2 Insignia OPAC.js
  47. +1 −1 Institute of Physics.js
  48. +2 −3 Intellixir.js
  49. +2 −2 Isidore.js
  50. +2 −2 JRC Publications Repository.js
  51. +2 −2 JSTOR.js
  52. +2 −2 Jahrbuch.js
  53. +1 −1 Japan Times Online.js
  54. +3 −3 Journal of Electronic Publishing.js
  55. +2 −2 Kommersant.js
  56. +1 −1 LA Times.js
  57. +2 −2 Le Devoir.js
  58. +1 −1 Legifrance.js
  59. +1 −1 Library Catalog (BiblioCommons).js
  60. +1 −1 Library Catalog (DRA).js
  61. +1 −1 Library Catalog (Dynix).js
  62. +1 −1 Library Catalog (GEAC).js
  63. +2 −2 Library Catalog (InnoPAC).js
  64. +1 −1 Library Catalog (PICA).js
  65. +1 −1 Library Catalog (SIRSI eLibrary).js
  66. +1 −1 Library Catalog (SIRSI).js
  67. +1 −1 Library Catalog (TLCYouSeeMore).js
  68. +1 −1 Library Catalog (VTLS).js
  69. +1 −1 LiveJournal.js
  70. +2 −2 Mailman.js
  71. +2 −2 Matbugat.ru.js
  72. +2 −2 MetaLib.js
  73. +1 −1 MetaPress.js
  74. +1 −1 NASA ADS.js
  75. +1 −1 Nagoya University OPAC.js
  76. +1 −1 National Bureau of Economic Research.js
  77. +1 −1 National Gallery of Art - USA.js
  78. +1 −1 National Library of Australia - Australian Newspapers.js
  79. +2 −2 National Library of Belarus.js
  80. +1 −1 Nature Publishing Group.js
  81. +1 −1 Neural Information Processing Systems.js
  82. +1 −1 Nuclear Receptor Signaling.js
  83. +2 −2 OCLC WorldCat FirstSearch.js
  84. +2 −2 ORCID.js
  85. +2 −2 OhioLINK.js
  86. +2 −2 Ovid.js
  87. +1 −1 Pleade.js
  88. +1 −1 ProQuest PolicyFile.js
  89. +1 −1 ProQuest.js
  90. +1 −1 Pubget.js
  91. +1 −1 Publications du Quebec.js
  92. +1 −1 SAGE Journals.js
  93. +1 −1 ScienceDirect.js
  94. +1 −1 Silverchair.js
  95. +5 −4 SlideShare.js
  96. +2 −2 Springer Link.js
  97. +1 −1 Stanford Encyclopedia of Philosophy.js
  98. +1 −1 Store norske leksikon.js
  99. +4 −3 Tatar zamani.js
  100. +2 −2 Tatpressa.ru.js
  101. +2 −2 The Australian.js
  102. +2 −2 The Free Dictionary.js
  103. +1 −1 The Hindu.js
  104. +1 −1 The Microfinance Gateway.js
  105. +2 −2 Treesearch.js
  106. +2 −2 Twitter.js
  107. +2 −2 Vanderbilt eJournals.js
  108. +2 −2 Verniana-Jules Verne Studies.js
  109. +1 −1 Wanfang Data.js
  110. +1 −1 Wikipedia.js
  111. +2 −2 Wildlife Biology in Practice.js
  112. +2 −2 Wiley Online Library.js
  113. +1 −1 World Shakespeare Bibliography Online.js
  114. +1 −1 YouTube.js
  115. +1 −1 arXiv.org.js
  116. +1 −1 dhistory.js
  117. +2 −2 digibib.net.js
  118. +2 −2 eLife.js
  119. +1 −1 ebrary.js
  120. +1 −1 etatar.ru.js
  121. +4 −3 feb-web.ru.js
  122. +1 −1 taz.de.js
@@ -2,14 +2,14 @@
"translatorID": "938ebe32-2b2e-4349-a5b3-b3a05d3de627",
"label": "ACS Publications",
"creator": "Sean Takats, Michael Berkowitz, Santawort, and Aurimas Vinckevicius",
"target": "https?://pubs\\.acs\\.org/(toc/|journal/|topic/|isbn/\\d|doi/(full/|abs/)?10\\.|action/doSearch\\?)",
"target": "^https?://pubs\\.acs\\.org/(toc/|journal/|topic/|isbn/\\d|doi/(full/|abs/)?10\\.|action/doSearch\\?)",
"minVersion": "4.0.5",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2016-08-23 18:35:28"
"lastUpdated": "2017-01-01 14:51:41"
}

function getSearchResults(doc, checkOnly, itemOpts) {
2 AIP.js
@@ -2,7 +2,7 @@
"translatorID": "48d3b115-7e09-4134-ad5d-0beda6296761",
"label": "AIP",
"creator": "Aurimas Vinckevicius",
"target": "^https?://scitation\\.aip\\.org/(?:search\\?|content/)",
"target": "^https?://scitation\\.aip\\.org/(search\\?|content/)",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
@@ -2,7 +2,7 @@
"translatorID": "a354331-981b-43de-a61-bc26dd1be3a9",
"label": "AMS MathSciNet",
"creator": "Simon Kornblith",
"target": "^https?://(www\\.)?ams\\.[^/]*/mathscinet(\\-getitem\\?|/search/(?:publications\\.html|publdoc\\.html))",
"target": "^https?://(www\\.)?ams\\.[^/]*/mathscinet(\\-getitem\\?|/search/(publications\\.html|publdoc\\.html))",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
@@ -2,7 +2,7 @@
"translatorID": "737216af-fc48-4aa5-bfae-560c9cfc5df5",
"label": "APN.ru",
"creator": "Avram Lyon",
"target": "^https?:\\/\\/www\\.apn\\.ru\\/",
"target": "^https?://www\\.apn\\.ru/",
"minVersion": "2.0",
"maxVersion": "",
"priority": 100,
@@ -2,7 +2,7 @@
"translatorID": "f318ab1e-71c6-4f67-8ac3-4b1144e5bf4e",
"label": "APS-Physics",
"creator": "Will Shanks",
"target": "^https?://(?:www\\.)?(physics)\\.aps\\.org([^/]*/(articles|story)/?|/browse(\\?|$))",
"target": "^https?://(www\\.)?(physics)\\.aps\\.org([^/]*/(articles|story)/?|/browse(\\?|$))",
"minVersion": "2.1.9",
"maxVersion": "",
"priority": 100,
@@ -2,14 +2,14 @@
"translatorID": "72cb2536-3211-41e0-ae8b-974c0385e085",
"label": "ARTFL Encyclopedie",
"creator": "Sean Takats, Sebastian Karcher",
"target": "^https?://artflsrv\\d+\\.uchicago\\.edu/cgi-bin/philologic/(getobject\\.pl\\?[cp]\\.[0-9]+:[0-9]+(:[0-9]+)?\\.encyclopedie|navigate.pl\\?encyclopedie|search3t\\?dbname=encyclopedie)",
"target": "^https?://artflsrv\\d+\\.uchicago\\.edu/cgi-bin/philologic/(getobject\\.pl\\?[cp]\\.[0-9]+:[0-9]+(:[0-9]+)?\\.encyclopedie|navigate\\.pl\\?encyclopedie|search3t\\?dbname=encyclopedie)",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcv",
"lastUpdated": "2014-03-12 04:43:57"
"lastUpdated": "2017-01-01 16:50:31"
}

function detectWeb(doc, url) {
@@ -2,7 +2,7 @@
"translatorID": "5278b20c-7c2c-4599-a785-12198ea648bf",
"label": "ARTstor",
"creator": "Charles Zeng & John Justin",
"target": "^https?://([^/]+\\.)?(artstor|sscommons)\\.org\\/(open)?library",
"target": "^https?://([^/]+\\.)?(artstor|sscommons)\\.org/(open)?library",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -2,7 +2,7 @@
"translatorID": "5f0ca39b-898a-4b1e-b98d-8cd0d6ce9801",
"label": "Airiti",
"creator": "Aurimas Vinckevicius",
"target": "^https?://(?:[^/]+\\.)?airitilibrary\\.com/Publication/alDetailedMesh",
"target": "^https?://([^/]+\\.)?airitilibrary\\.com/Publication/alDetailedMesh",
"minVersion": "3.0",
"maxVersion": "",
"priority": 110,
@@ -3,7 +3,7 @@
"translatorType":4,
"label":"Alexander Street Press",
"creator":"John West and Michael Berkowitz",
"target":"http://(?:www\\.)alexanderstreet",
"target":"http://(www\\.)alexanderstreet",
"minVersion":"1.0.0b4.r5",
"maxVersion":"",
"priority":100,
@@ -2,7 +2,7 @@
"translatorID": "ea531652-cdeb-4ec2-940e-627d4b107263",
"label": "AlterNet",
"creator": "Jesse Johnson, BBUCommander",
"target": "^https?://(?:www\\.)alternet\\.org",
"target": "^https?://(www\\.)alternet\\.org",
"minVersion": "2.1",
"maxVersion": "",
"priority": 100,
@@ -2,7 +2,7 @@
"translatorID": "e8fc7ebc-b63d-4eb3-a16c-91da232f7220",
"label": "Aluka",
"creator": "Philipp Zumstein",
"target": "^https?://(?:www\\.)aluka\\.org/(?:stable/|struggles/search\\?|struggles/collection/)",
"target": "^https?://(www\\.)aluka\\.org/(stable/|struggles/search\\?|struggles/collection/)",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
@@ -2,7 +2,7 @@
"translatorID": "96b9f483-c44d-5784-cdad-ce21b984fe01",
"label": "Amazon",
"creator": "Sean Takats, Michael Berkowitz, and Simon Kornblith",
"target": "^https?://((?:www\\.)|(?:smile\\.))?amazon",
"target": "^https?://((www\\.)|(smile\\.))?amazon",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
@@ -2,14 +2,14 @@
"translatorID": "5f22bd25-5b70-11e1-bb1d-c4f24aa18c1e",
"label": "Annual Reviews",
"creator": "Aurimas Vinckevicius",
"target": "https?://[^/]*annualreviews\\.org(:[\\d]+)?(?=/)[^?]*(/(toc|journal|doi)/|showMost(Read|Cited)Articles|doSearch)",
"target": "^https?://[^/]*annualreviews\\.org(:[\\d]+)?(?=/)[^?]*(/(toc|journal|doi)/|showMost(Read|Cited)Articles|doSearch)",
"minVersion": "3.0",
"maxVersion": "",
"priority": 150,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2016-09-03 11:19:25"
"lastUpdated": "2017-01-01 15:19:19"
}

/**
@@ -2,7 +2,7 @@
"translatorID": "5af42734-7cd5-4c69-97fc-bc406999bdba",
"label": "Atypon Journals",
"creator": "Sebastian Karcher",
"target": "^https?://[^?#]+(?:/doi/((?:abs|abstract|full|figure|ref|citedby|book)/)?10\\.|/action/doSearch\\?)|^https?://[^/]+/toc/",
"target": "^https?://[^?#]+(/doi/((abs|abstract|full|figure|ref|citedby|book)/)?10\\.|/action/doSearch\\?)|^https?://[^/]+/toc/",
"minVersion": "3.0",
"maxVersion": "",
"priority": 270,
@@ -2,7 +2,7 @@
"translatorID": "5ed5ab01-899f-4a3b-a74c-290fb2a1c9a4",
"label": "AustLII and NZLII",
"creator": "Bill McKinney and Sebastian Karcher",
"target": "^https?://www\\.(?:austlii\\.edu\\.au|nzlii\\.org)",
"target": "^https?://www\\.(austlii\\.edu\\.au|nzlii\\.org)",
"minVersion": "2.1.9",
"maxVersion": "",
"priority": 100,
@@ -2,7 +2,7 @@
"translatorID": "5ae63913-669a-4792-9f45-e089a37de9ab",
"label": "BAILII",
"creator": "Bill McKinney",
"target": "^https?:\\/\\/www\\.bailii\\.org(?:\\/cgi\\-bin\\/markup\\.cgi\\?doc\\=)?\\/\\w+\\/cases\\/.+",
"target": "^https?://www\\.bailii\\.org(/cgi\\-bin/markup\\.cgi\\?doc\\=)?/\\w+/cases/.+",
"minVersion": "1.0.0b4.r1",
"maxVersion": "",
"priority": 100,
2 BBC.js
@@ -2,7 +2,7 @@
"translatorID": "f4130157-93f7-4493-8f24-a7c85549013d",
"label": "BBC",
"creator": "Philipp Zumstein",
"target": "^https?://(?:www|news?)\\.bbc\\.(co\\.uk|com)",
"target": "^https?://(www|news?)\\.bbc\\.(co\\.uk|com)",
"minVersion": "2.1",
"maxVersion": "",
"priority": 100,
@@ -2,7 +2,7 @@
"translatorID": "ecd1b7c6-8d31-4056-8c15-1807b2489254",
"label": "BOCC",
"creator": "José Antonio Meira da Rocha",
"target": "^https?:\\/\\/[^/]*bocc[^/]*/(?:_listas|_esp)",
"target": "^https?://[^/]*bocc[^/]*/(_listas|_esp)",
"minVersion": "1.0",
"maxVersion": "",
"priority": 100,
@@ -2,14 +2,14 @@
"translatorID": "7d03e952-04ad-4d1d-845a-50b9eb545b10",
"label": "BOFiP-Impôts",
"creator": "Guillaume Adreani",
"target": "https?://bofip\\.impots\\.gouv\\.fr/bofip/",
"target": "^https?://bofip\\.impots\\.gouv\\.fr/bofip/",
"minVersion": "2.1.9",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsib",
"lastUpdated": "2016-11-01 18:20:19"
"lastUpdated": "2017-01-01 14:53:42"
}

/* FW LINE 59:b820c6d */ function flatten(t){var e=new Array;for(var i in t){var r=t[i];r instanceof Array?e=e.concat(flatten(r)):e.push(r)}return e}var FW={_scrapers:new Array};FW._Base=function(){this.callHook=function(t,e,i,r){if("object"==typeof this.hooks){var n=this.hooks[t];"function"==typeof n&&n(e,i,r)}},this.evaluateThing=function(t,e,i){var r=typeof t;if("object"===r){if(t instanceof Array){var n=this.evaluateThing,a=t.map(function(t){return n(t,e,i)});return flatten(a)}return t.evaluate(e,i)}return"function"===r?t(e,i):t},this.makeItems=function(t,e,i,r,n){n()}},FW.Scraper=function(t){FW._scrapers.push(new FW._Scraper(t))},FW._Scraper=function(t){for(x in t)this[x]=t[x];this._singleFieldNames=["abstractNote","applicationNumber","archive","archiveLocation","artworkMedium","artworkSize","assignee","audioFileType","audioRecordingType","billNumber","blogTitle","bookTitle","callNumber","caseName","code","codeNumber","codePages","codeVolume","committee","company","conferenceName","country","court","date","dateDecided","dateEnacted","dictionaryTitle","distributor","docketNumber","documentNumber","DOI","edition","encyclopediaTitle","episodeNumber","extra","filingDate","firstPage","forumTitle","genre","history","institution","interviewMedium","ISBN","ISSN","issue","issueDate","issuingAuthority","journalAbbreviation","label","language","legalStatus","legislativeBody","letterType","libraryCatalog","manuscriptType","mapType","medium","meetingName","nameOfAct","network","number","numberOfVolumes","numPages","pages","patentNumber","place","postType","presentationType","priorityNumbers","proceedingsTitle","programTitle","programmingLanguage","publicLawNumber","publicationTitle","publisher","references","reportNumber","reportType","reporter","reporterVolume","rights","runningTime","scale","section","series","seriesNumber","seriesText","seriesTitle","session","shortTitle","studio","subject","system","thesisType","title","type","university","url","version","videoRecordingType","volume","websiteTitle","websiteType"],this._makeAttachments=function(t,e,i,r){if(i instanceof Array)i.forEach(function(i){this._makeAttachments(t,e,i,r)},this);else if("object"==typeof i){var n=i.urls||i.url,a=i.types||i.type,s=i.titles||i.title,o=i.snapshots||i.snapshot,u=this.evaluateThing(n,t,e),l=this.evaluateThing(s,t,e),c=this.evaluateThing(a,t,e),h=this.evaluateThing(o,t,e);u instanceof Array||(u=[u]);for(var f in u){var p,m,v,d=u[f];p=c instanceof Array?c[f]:c,m=l instanceof Array?l[f]:l,v=h instanceof Array?h[f]:h,r.attachments.push({url:d,title:m,mimeType:p,snapshot:v})}}},this.makeItems=function(t,e,i,r,n){var a=new Zotero.Item(this.itemType);a.url=e;for(var s in this._singleFieldNames){var o=this._singleFieldNames[s];if(this[o]){var u=this.evaluateThing(this[o],t,e);u instanceof Array?a[o]=u[0]:a[o]=u}}var l=["creators","tags"];for(var c in l){var h=l[c],f=this.evaluateThing(this[h],t,e);if(f)for(var p in f)a[h].push(f[p])}this._makeAttachments(t,e,this.attachments,a),r(a,this,t,e),n()}},FW._Scraper.prototype=new FW._Base,FW.MultiScraper=function(t){FW._scrapers.push(new FW._MultiScraper(t))},FW._MultiScraper=function(t){for(x in t)this[x]=t[x];this._mkSelectItems=function(t,e){var i=new Object;for(var r in t)i[e[r]]=t[r];return i},this._selectItems=function(t,e,i){var r=new Array;Zotero.selectItems(this._mkSelectItems(t,e),function(t){for(var e in t)r.push(e);i(r)})},this._mkAttachments=function(t,e,i){var r=this.evaluateThing(this.attachments,t,e),n=new Object;if(r)for(var a in i)n[i[a]]=r[a];return n},this._makeChoices=function(t,e,i,r,n){if(t instanceof Array)t.forEach(function(t){this._makeTitlesUrls(t,e,i,r,n)},this);else if("object"==typeof t){var a=t.urls||t.url,s=t.titles||t.title,o=this.evaluateThing(a,e,i),u=this.evaluateThing(s,e,i),l=u instanceof Array;o instanceof Array||(o=[o]);for(var c in o){var h,f=o[c];h=l?u[c]:u,n.push(f),r.push(h)}}},this.makeItems=function(t,e,i,r,n){if(this.beforeFilter){var a=this.beforeFilter(t,e);if(a!=e)return void this.makeItems(t,a,i,r,n)}var s=[],o=[];this._makeChoices(this.choices,t,e,s,o);var u=this._mkAttachments(t,e,o),l=this.itemTrans;this._selectItems(s,o,function(t){if(t){var e=function(t){var e=t.documentURI,i=l;void 0===i&&(i=FW.getScraper(t,e)),void 0===i||i.makeItems(t,e,u[e],r,function(){})};Zotero.Utilities.processDocuments(t,e,n)}else n()})}},FW._MultiScraper.prototype=new FW._Base,FW.WebDelegateTranslator=function(t){return new FW._WebDelegateTranslator(t)},FW._WebDelegateTranslator=function(t){for(x in t)this[x]=t[x];this.makeItems=function(t,e,i,r,n){var a=this,s=Zotero.loadTranslator("web");s.setHandler("itemDone",function(i,n){r(n,a,t,e)}),s.setDocument(t),this.translatorId?(s.setTranslator(this.translatorId),s.translate()):(s.setHandler("translators",function(t,e){e.length&&(s.setTranslator(e[0]),s.translate())}),s.getTranslators()),n()}},FW._WebDelegateTranslator.prototype=new FW._Base,FW._StringMagic=function(){this._filters=new Array,this.addFilter=function(t){return this._filters.push(t),this},this.split=function(t){return this.addFilter(function(e){return e.split(t).filter(function(t){return""!=t})})},this.replace=function(t,e,i){return this.addFilter(function(r){return r.match(t)?r.replace(t,e,i):r})},this.prepend=function(t){return this.replace(/^/,t)},this.append=function(t){return this.replace(/$/,t)},this.remove=function(t,e){return this.replace(t,"",e)},this.trim=function(){return this.addFilter(function(t){return Zotero.Utilities.trim(t)})},this.trimInternal=function(){return this.addFilter(function(t){return Zotero.Utilities.trimInternal(t)})},this.match=function(t,e){return e||(e=0),this.addFilter(function(i){var r=i.match(t);return void 0===r||null===r?void 0:r[e]})},this.cleanAuthor=function(t,e){return this.addFilter(function(i){return Zotero.Utilities.cleanAuthor(i,t,e)})},this.key=function(t){return this.addFilter(function(e){return e[t]})},this.capitalizeTitle=function(){return this.addFilter(function(t){return Zotero.Utilities.capitalizeTitle(t)})},this.unescapeHTML=function(){return this.addFilter(function(t){return Zotero.Utilities.unescapeHTML(t)})},this.unescape=function(){return this.addFilter(function(t){return unescape(t)})},this._applyFilters=function(t,e){for(i in this._filters){t=flatten(t),t=t.filter(function(t){return void 0!==t&&null!==t});for(var r=0;r<t.length;r++)try{if(void 0===t[r]||null===t[r])continue;t[r]=this._filters[i](t[r],e)}catch(n){t[r]=void 0,Zotero.debug("Caught exception "+n+"on filter: "+this._filters[i])}t=t.filter(function(t){return void 0!==t&&null!==t})}return flatten(t)}},FW.PageText=function(){return new FW._PageText},FW._PageText=function(){this._filters=new Array,this.evaluate=function(t){var e=[t.documentElement.innerHTML];return e=this._applyFilters(e,t),0==e.length?!1:e}},FW._PageText.prototype=new FW._StringMagic,FW.Url=function(){return new FW._Url},FW._Url=function(){this._filters=new Array,this.evaluate=function(t,e){var i=[e];return i=this._applyFilters(i,t),0==i.length?!1:i}},FW._Url.prototype=new FW._StringMagic,FW.Xpath=function(t){return new FW._Xpath(t)},FW._Xpath=function(t){this._xpath=t,this._filters=new Array,this.text=function(){var t=function(t){return"object"==typeof t&&t.textContent?t.textContent:t};return this.addFilter(t),this},this.sub=function(t){var e=function(e,i){var r=i.evaluate(t,e,null,XPathResult.ANY_TYPE,null);return r?r.iterateNext():void 0};return this.addFilter(e),this},this.evaluate=function(t){var e=t.evaluate(this._xpath,t,null,XPathResult.ANY_TYPE,null),i=e.resultType,r=new Array;if(i==XPathResult.STRING_TYPE)r.push(e.stringValue);else if(i==XPathResult.BOOLEAN_TYPE)r.push(e.booleanValue);else if(i==XPathResult.NUMBER_TYPE)r.push(e.numberValue);else if(i==XPathResult.ORDERED_NODE_ITERATOR_TYPE||i==XPathResult.UNORDERED_NODE_ITERATOR_TYPE)for(var n;n=e.iterateNext();)r.push(n);return r=this._applyFilters(r,t),0==r.length?!1:r}},FW._Xpath.prototype=new FW._StringMagic,FW.detectWeb=function(t,e){for(var i in FW._scrapers){var r=FW._scrapers[i],n=r.evaluateThing(r.itemType,t,e),a=r.evaluateThing(r.detect,t,e);if(a.length>0&&a[0])return n}},FW.getScraper=function(t,e){var i=FW.detectWeb(t,e);return FW._scrapers.filter(function(r){return r.evaluateThing(r.itemType,t,e)==i&&r.evaluateThing(r.detect,t,e)})[0]},FW.doWeb=function(t,e){var i=FW.getScraper(t,e);i.makeItems(t,e,[],function(t,e,i,r){e.callHook("scraperDone",t,i,r),t.title||(t.title=""),t.complete()},function(){Zotero.done()}),Zotero.wait()};

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -2,14 +2,14 @@
"translatorID": "75ccea3c-fdb8-4473-8203-ceb27f3395f8",
"label": "BioMed Central",
"creator": "Philipp Zumstein",
"target": "^https?:\\/\\/[^\\.]+\\.biomedcentral\\.com\\/(articles|search)",
"target": "^https?://[^\\.]+\\.biomedcentral\\.com/(articles|search)",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2016-09-08 06:17:39"
"lastUpdated": "2017-01-01 16:01:50"
}

/*
@@ -2,7 +2,7 @@
"translatorID": "899d10f5-3f35-40e6-8dfb-f8ee2dfb1849",
"label": "CCfr (BnF)",
"creator": "Sylvain Machefert, Aurimas Vinckevicius",
"target": "^https?://ccfr\\.bnf\\.fr/portailccfr/.*\\b(?:action=search|menu=menu_view_grappage|search\\.jsp)\\b",
"target": "^https?://ccfr\\.bnf\\.fr/portailccfr/.*\\b(action=search|menu=menu_view_grappage|search\\.jsp)\\b",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
@@ -2,14 +2,14 @@
"translatorID": "5c95b67b-41c5-4f55-b71a-48d5d7183063",
"label": "CNKI",
"creator": "Aurimas Vinckevicius",
"target": "^https?://(?:[^/]+\\.)?cnki.net",
"target": "^https?://([^/]+\\.)?cnki\\.net",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcs",
"lastUpdated": "2013-08-25 04:10:34"
"lastUpdated": "2017-01-01 16:51:46"
}

/*
@@ -2,7 +2,7 @@
"translatorID": "84799379-7bc5-4e55-9817-baf297d129fe",
"label": "CanLII",
"creator": "Sebastian Karcher",
"target": "^https?://(?:www\\.)?canlii\\.org/(?:en|fr)/",
"target": "^https?://(www\\.)?canlii\\.org/(en|fr)/",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
@@ -2,14 +2,14 @@
"translatorID": "8917b41c-8527-4ee7-b2dd-bcbc3fa5eabd",
"label": "CiteULike",
"creator": "Sean Takats",
"target": "https?://(?:www\\.)?citeulike.org(?:.*/tag/[^/]*$|/search/|/journal/|/user/|/group/[0-9]+/library$|/\\?page=[0-9]+$|/.*article/[0-9]+$|/$)",
"target": "^https?://(www\\.)?citeulike\\.org(.*/tag/[^/]*$|/search/|/journal/|/user/|/group/[0-9]+/library$|/\\?page=[0-9]+$|/.*article/[0-9]+$|/$)",
"minVersion": "1.0.0b4.r5",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2013-02-24 23:19:16"
"lastUpdated": "2017-01-01 16:51:21"
}

function detectWeb(doc, url){
@@ -2,7 +2,7 @@
"translatorID": "a55463ba-e403-415b-80d4-284d5f9b4b15",
"label": "Clinical Key",
"creator": "Jaret M. Karnuta",
"target": "^https://(www\\.|www-)clinicalkey(\\.|-)com",
"target": "^https?://(www\\.|www-)clinicalkey(\\.|-)com",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
@@ -2,14 +2,14 @@
"translatorID": "a326fc49-60c2-405b-8f44-607e5d18b9ad",
"label": "Code4Lib Journal",
"creator": "Michael Berkowitz",
"target": "http://journal.code4lib.org/",
"target": "^https?://journal\\.code4lib\\.org/",
"minVersion": "1.0.0b4.r5",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2012-05-11 06:22:36"
"lastUpdated": "2017-01-01 16:52:07"
}

function detectWeb(doc, url) {
Oops, something went wrong.

0 comments on commit ed21c7b

Please sign in to comment.
You can’t perform that action at this time.