{ "translatorID": "91c7b393-af05-476c-ae72-ae244d2347f4", "label": "Microsoft Academic Search", "creator": "Aurimas Vinckevicius", "target": "https?://[^/]*academic\\.research\\.microsoft\\.com", "minVersion": "3.0", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "gcsbv", "lastUpdated": "2014-03-23 11:12:39" } /** Copyright (c) 2012 Aurimas Vinckevicius This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ function getSearchResults(doc) { if(!getSearchResults.results) { getSearchResults.results = ZU.xpath(doc, '//div[@id="ctl00_divCenter"]//li[@class="paper-item"]\ //a[substring(@id, string-length(@id)-5)="_Title"]'); } return getSearchResults.results; } function scrape(doc, url) { var pubID = url.match(/\/Publication\/(\d+)/)[1]; var exportUrl = 'http://academic.research.microsoft.com/' + pubID + '.bib?type=2&format=0'; //fetch attachments var attachments = ZU.xpath(doc, '//ul[@id="downloadList"]//li'); var type, location, link, att = new Array(); var pdffound = false; for(var i=0, n=attachments.length; i