{ "translatorID": "94a8328a-ec87-4ba0-82b6-cf3000ea1dee", "label": "PyPI", "creator": "Philipp Zumstein", "target": "^https?://pypi\\.org/(project|search)", "minVersion": "3.0", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", "lastUpdated": "2018-11-03 08:21:27" } /* ***** BEGIN LICENSE BLOCK ***** Copyright © 2017 Philipp Zumstein This file is part of Zotero. Zotero 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. Zotero 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 Zotero. If not, see . ***** END LICENSE BLOCK ***** */ function detectWeb(doc, url) { if (url.includes('/project')) { return "computerProgram"; } else if (getSearchResults(doc, true)) { return "multiple"; } } function getSearchResults(doc, checkOnly) { var items = {}; var found = false; var rows = ZU.xpath(doc, '//a[contains(@class, "package-snippet") and contains(@href, "/project/")]'); for (var i=0; i os.textContent.trim()); item.system = osList.join(', '); } item.attachments.push({ title: "Snapshot", document: doc }); item.complete(); } /** BEGIN TEST CASES **/ var testCases = [ { "type": "web", "url": "https://pypi.org/search/?q=zotero", "items": "multiple" }, { "type": "web", "url": "https://pypi.org/project/simplejson/3.10.0/", "items": [ { "itemType": "computerProgram", "title": "simplejson: Simple, fast, extensible JSON encoder/decoder for Python", "creators": [ { "firstName": "Bob", "lastName": "Ippolito", "creatorType": "author" } ], "libraryCatalog": "PyPI", "programmingLanguage": "Python", "rights": "Academic Free License, MIT License", "shortTitle": "simplejson", "url": "http://github.com/simplejson/simplejson", "attachments": [ { "title": "Snapshot" } ], "tags": [ { "tag": "Software Development - Libraries - Python Modules" } ], "notes": [], "seeAlso": [] } ] }, { "type": "web", "url": "https://pypi.org/search/?c=Topic+%3A%3A+Scientific%2FEngineering+%3A%3A+Image+Recognition", "items": "multiple" }, { "type": "web", "url": "https://pypi.org/project/lxml/3.7.3/", "items": [ { "itemType": "computerProgram", "title": "lxml: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.", "creators": [ { "firstName": "lxml dev", "lastName": "team", "creatorType": "author" } ], "libraryCatalog": "PyPI", "programmingLanguage": "C, Cython, Python", "rights": "BSD License", "shortTitle": "lxml", "system": "OS Independent", "url": "http://lxml.de/", "attachments": [ { "title": "Snapshot" } ], "tags": [ { "tag": "Software Development - Libraries - Python Modules" }, { "tag": "Text Processing - Markup - HTML" }, { "tag": "Text Processing - Markup - XML" } ], "notes": [], "seeAlso": [] } ] }, { "type": "web", "url": "https://pypi.org/project/papis-zotero/", "items": [ { "itemType": "computerProgram", "title": "papis-zotero: Interact with zotero using papis", "creators": [ { "firstName": "Alejandro", "lastName": "Gallo", "creatorType": "author" } ], "libraryCatalog": "PyPI", "programmingLanguage": "Python", "rights": "GNU General Public License v3", "shortTitle": "papis-zotero", "system": "MacOS, POSIX, Unix", "url": "https://github.com/papis/papis-zotero", "attachments": [ { "title": "Snapshot" } ], "tags": [ { "tag": "Utilities" }, { "tag": "bibtex," }, { "tag": "biliography" }, { "tag": "cli," }, { "tag": "management," }, { "tag": "papis," }, { "tag": "zotero," } ], "notes": [], "seeAlso": [] } ] } ] /** END TEST CASES **/