{"action":"created","comment":{"url":"https://api.github.com/repos/zotero/translators/pulls/comments/48977510","id":48977510,"diff_hunk":"@@ -0,0 +1,236 @@\n+{\n+\t\"translatorID\": \"ce5f2849-4500-47cc-8d7d-3fc0a1de9848\",\n+\t\"label\": \"Microbiology Society Journals\",\n+\t\"creator\": \"Philipp Zumstein\",\n+\t\"target\": \"https?://(www\\\\.)?(\\\\w)+.microbiologyresearch.org/(content/journal/|search?)\",\n+\t\"minVersion\": \"3.0\",\n+\t\"maxVersion\": \"\",\n+\t\"priority\": 100,\n+\t\"inRepository\": true,\n+\t\"translatorType\": 4,\n+\t\"browserSupport\": \"gcsibv\",\n+\t\"lastUpdated\": \"2016-01-06 13:32:11\"\n+}\n+\n+/*\n+    ***** BEGIN LICENSE BLOCK *****\n+\n+    Copyright © 2016 Philipp Zumstein\n+\n+    This file is part of Zotero.\n+\n+    Zotero is free software: you can redistribute it and/or modify\n+    it under the terms of the GNU Affero General Public License as published by\n+    the Free Software Foundation, either version 3 of the License, or\n+    (at your option) any later version.\n+\n+    Zotero is distributed in the hope that it will be useful,\n+    but WITHOUT ANY WARRANTY; without even the implied warranty of\n+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+    GNU Affero General Public License for more details.\n+\n+    You should have received a copy of the GNU Affero General Public License\n+    along with Zotero. If not, see <http://www.gnu.org/licenses/>.\n+\n+    ***** END LICENSE BLOCK *****\n+*/\n+\n+function detectWeb(doc, url) {\n+    if ( url.search(/\\/content\\/journal\\/\\w+\\/10\\./) >-1) {\n+    \t//e.g. http://jmm.microbiologyresearch.org/content/journal/jmm/10.1099/00222615-15-2-189\n+        return \"journalArticle\";\n+    }\n+    if (getSearchResults(doc, true)) {\n+    \t//e.g. http://ijs.microbiologyresearch.org/content/journal/ijsem/65/11\n+    \t//http://jmm.microbiologyresearch.org/search?option1=author&noRedirect=true&value1=Ateequr+Rehman&facetOptions=2&facetNames=pub_author_facet&operator2=AND&option2=pub_author_facet&value2=%27Patricia+Lepage%27\n+        return \"multiple\";\n+    }\n+}\n+\n+function getSearchResults(doc, checkOnly) {\n+    var items = {};\n+    var found = false;\n+    var rows = ZU.xpath(doc, '//li[contains(@class, \"list-group-item\")]//h4/a');\n+    for (var i=0; i<rows.length; i++) {\n+        var href = rows[i].href;\n+        var title = ZU.trimInternal(rows[i].textContent);\n+        if (!href || !title) continue;\n+        if (checkOnly) return true;\n+        found = true;\n+        items[href] = title;\n+    }\n+    return found ? items : false;\n+}\n+\n+\n+function doWeb(doc, url) {\n+    if (detectWeb(doc, url) == \"multiple\") {\n+        Zotero.selectItems(getSearchResults(doc, false), function (items) {\n+            if (!items) {\n+                return true;\n+            }\n+            var articles = new Array();\n+            for (var i in items) {\n+                articles.push(i);\n+            }\n+            ZU.processDocuments(articles, scrape);\n+        });\n+    } else {\n+        scrape(doc, url);\n+    }\n+}\n+\n+function scrape(doc, url) {\n+\tvar risURL;\n+\tvar node = ZU.xpath(doc, '//ul[@id=\"export-list\"]/li/a[contains(@title,\"RefWorks\")]');\n+\tif (node.length > 0) {\n+\t\trisURL = node[0].href;\n+\t} else {\n+\t\trisURL = url + \"/cite/refworks\";\n+\t}\n+\n+    ZU.doGet(risURL, function(text) {\n+        var translator = Zotero.loadTranslator(\"import\");\n+        translator.setTranslator(\"1a3506da-a303-4b0a-a1cd-f216e6138d86\");\n+        translator.setString(text);\n+        translator.setHandler(\"itemDone\", function(obj, item) {\n+            var pdfURL;\n+\t\t    pdfURL = ZU.xpath(doc, '//div[contains(@class,\"textoptionsFulltext\")]//a[contains(@class,\"pdf\")]');\n+            if (pdfURL.length > 0) {\n+                item.attachments.push({\n+                    url: pdfURL[0].href,\n+                    title: \"Full Text PDF\",","path":"Microbiology Society Journals.js","position":null,"original_position":102,"commit_id":"f6d6ed73c2a645d693ad6c0f38241afdf4519921","original_commit_id":"230464f6b19696446fa4065c515621053ab59a10","user":{"login":"zuphilip","id":5199995,"avatar_url":"https://avatars.githubusercontent.com/u/5199995?v=3","gravatar_id":"","url":"https://api.github.com/users/zuphilip","html_url":"https://github.com/zuphilip","followers_url":"https://api.github.com/users/zuphilip/followers","following_url":"https://api.github.com/users/zuphilip/following{/other_user}","gists_url":"https://api.github.com/users/zuphilip/gists{/gist_id}","starred_url":"https://api.github.com/users/zuphilip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zuphilip/subscriptions","organizations_url":"https://api.github.com/users/zuphilip/orgs","repos_url":"https://api.github.com/users/zuphilip/repos","events_url":"https://api.github.com/users/zuphilip/events{/privacy}","received_events_url":"https://api.github.com/users/zuphilip/received_events","type":"User","site_admin":false},"body":"No, I don't know more about the naming of attachments. Will the `url` of attachments be saved as well in the database?\r\n\r\n<blockquote>Also, looking at your list -- we should generalize this a bit and turn it into a styleguide for translator coding on the Zotero Wiki.</blockquote>\r\nSure, that is just a collection of wise words mainly by you and Aurimas. Feel free to use whatever is useful for the Zotero Translator Wiki. BTW currently I am using quite often <a href=\"https://github.com/zuphilip/translators/wiki/Common-code-blocks-for-translators\">my code blocks</a>, which saves a lot of time.","created_at":"2016-01-06T16:37:54Z","updated_at":"2016-01-06T16:37:54Z","html_url":"https://github.com/zotero/translators/pull/996#discussion_r48977510","pull_request_url":"https://api.github.com/repos/zotero/translators/pulls/996","_links":{"self":{"href":"https://api.github.com/repos/zotero/translators/pulls/comments/48977510"},"html":{"href":"https://github.com/zotero/translators/pull/996#discussion_r48977510"},"pull_request":{"href":"https://api.github.com/repos/zotero/translators/pulls/996"}}},"pull_request":{"url":"https://api.github.com/repos/zotero/translators/pulls/996","id":55213163,"html_url":"https://github.com/zotero/translators/pull/996","diff_url":"https://github.com/zotero/translators/pull/996.diff","patch_url":"https://github.com/zotero/translators/pull/996.patch","issue_url":"https://api.github.com/repos/zotero/translators/issues/996","number":996,"state":"open","locked":false,"title":"New Translator: Microbiology Society Journals","user":{"login":"zuphilip","id":5199995,"avatar_url":"https://avatars.githubusercontent.com/u/5199995?v=3","gravatar_id":"","url":"https://api.github.com/users/zuphilip","html_url":"https://github.com/zuphilip","followers_url":"https://api.github.com/users/zuphilip/followers","following_url":"https://api.github.com/users/zuphilip/following{/other_user}","gists_url":"https://api.github.com/users/zuphilip/gists{/gist_id}","starred_url":"https://api.github.com/users/zuphilip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zuphilip/subscriptions","organizations_url":"https://api.github.com/users/zuphilip/orgs","repos_url":"https://api.github.com/users/zuphilip/repos","events_url":"https://api.github.com/users/zuphilip/events{/privacy}","received_events_url":"https://api.github.com/users/zuphilip/received_events","type":"User","site_admin":false},"body":"This closes #919","created_at":"2016-01-06T13:36:07Z","updated_at":"2016-01-06T16:37:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33971dc44bb6953010c37dc9c4a11986b587b888","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zotero/translators/pulls/996/commits","review_comments_url":"https://api.github.com/repos/zotero/translators/pulls/996/comments","review_comment_url":"https://api.github.com/repos/zotero/translators/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zotero/translators/issues/996/comments","statuses_url":"https://api.github.com/repos/zotero/translators/statuses/f6d6ed73c2a645d693ad6c0f38241afdf4519921","head":{"label":"zuphilip:microbio","ref":"microbio","sha":"f6d6ed73c2a645d693ad6c0f38241afdf4519921","user":{"login":"zuphilip","id":5199995,"avatar_url":"https://avatars.githubusercontent.com/u/5199995?v=3","gravatar_id":"","url":"https://api.github.com/users/zuphilip","html_url":"https://github.com/zuphilip","followers_url":"https://api.github.com/users/zuphilip/followers","following_url":"https://api.github.com/users/zuphilip/following{/other_user}","gists_url":"https://api.github.com/users/zuphilip/gists{/gist_id}","starred_url":"https://api.github.com/users/zuphilip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zuphilip/subscriptions","organizations_url":"https://api.github.com/users/zuphilip/orgs","repos_url":"https://api.github.com/users/zuphilip/repos","events_url":"https://api.github.com/users/zuphilip/events{/privacy}","received_events_url":"https://api.github.com/users/zuphilip/received_events","type":"User","site_admin":false},"repo":{"id":23522231,"name":"translators","full_name":"zuphilip/translators","owner":{"login":"zuphilip","id":5199995,"avatar_url":"https://avatars.githubusercontent.com/u/5199995?v=3","gravatar_id":"","url":"https://api.github.com/users/zuphilip","html_url":"https://github.com/zuphilip","followers_url":"https://api.github.com/users/zuphilip/followers","following_url":"https://api.github.com/users/zuphilip/following{/other_user}","gists_url":"https://api.github.com/users/zuphilip/gists{/gist_id}","starred_url":"https://api.github.com/users/zuphilip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zuphilip/subscriptions","organizations_url":"https://api.github.com/users/zuphilip/orgs","repos_url":"https://api.github.com/users/zuphilip/repos","events_url":"https://api.github.com/users/zuphilip/events{/privacy}","received_events_url":"https://api.github.com/users/zuphilip/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zuphilip/translators","description":"Zotero Translators","fork":true,"url":"https://api.github.com/repos/zuphilip/translators","forks_url":"https://api.github.com/repos/zuphilip/translators/forks","keys_url":"https://api.github.com/repos/zuphilip/translators/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zuphilip/translators/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zuphilip/translators/teams","hooks_url":"https://api.github.com/repos/zuphilip/translators/hooks","issue_events_url":"https://api.github.com/repos/zuphilip/translators/issues/events{/number}","events_url":"https://api.github.com/repos/zuphilip/translators/events","assignees_url":"https://api.github.com/repos/zuphilip/translators/assignees{/user}","branches_url":"https://api.github.com/repos/zuphilip/translators/branches{/branch}","tags_url":"https://api.github.com/repos/zuphilip/translators/tags","blobs_url":"https://api.github.com/repos/zuphilip/translators/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zuphilip/translators/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zuphilip/translators/git/refs{/sha}","trees_url":"https://api.github.com/repos/zuphilip/translators/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zuphilip/translators/statuses/{sha}","languages_url":"https://api.github.com/repos/zuphilip/translators/languages","stargazers_url":"https://api.github.com/repos/zuphilip/translators/stargazers","contributors_url":"https://api.github.com/repos/zuphilip/translators/contributors","subscribers_url":"https://api.github.com/repos/zuphilip/translators/subscribers","subscription_url":"https://api.github.com/repos/zuphilip/translators/subscription","commits_url":"https://api.github.com/repos/zuphilip/translators/commits{/sha}","git_commits_url":"https://api.github.com/repos/zuphilip/translators/git/commits{/sha}","comments_url":"https://api.github.com/repos/zuphilip/translators/comments{/number}","issue_comment_url":"https://api.github.com/repos/zuphilip/translators/issues/comments{/number}","contents_url":"https://api.github.com/repos/zuphilip/translators/contents/{+path}","compare_url":"https://api.github.com/repos/zuphilip/translators/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zuphilip/translators/merges","archive_url":"https://api.github.com/repos/zuphilip/translators/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zuphilip/translators/downloads","issues_url":"https://api.github.com/repos/zuphilip/translators/issues{/number}","pulls_url":"https://api.github.com/repos/zuphilip/translators/pulls{/number}","milestones_url":"https://api.github.com/repos/zuphilip/translators/milestones{/number}","notifications_url":"https://api.github.com/repos/zuphilip/translators/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zuphilip/translators/labels{/name}","releases_url":"https://api.github.com/repos/zuphilip/translators/releases{/id}","created_at":"2014-08-31T20:18:19Z","updated_at":"2015-08-18T13:54:34Z","pushed_at":"2016-01-06T16:22:54Z","git_url":"git://github.com/zuphilip/translators.git","ssh_url":"git@github.com:zuphilip/translators.git","clone_url":"https://github.com/zuphilip/translators.git","svn_url":"https://github.com/zuphilip/translators","homepage":"http://www.zotero.org/support/dev/translators","size":11942,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"zotero:master","ref":"master","sha":"7b98f594bec93c6043a89201ad654470c338ecaa","user":{"login":"zotero","id":891917,"avatar_url":"https://avatars.githubusercontent.com/u/891917?v=3","gravatar_id":"","url":"https://api.github.com/users/zotero","html_url":"https://github.com/zotero","followers_url":"https://api.github.com/users/zotero/followers","following_url":"https://api.github.com/users/zotero/following{/other_user}","gists_url":"https://api.github.com/users/zotero/gists{/gist_id}","starred_url":"https://api.github.com/users/zotero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zotero/subscriptions","organizations_url":"https://api.github.com/users/zotero/orgs","repos_url":"https://api.github.com/users/zotero/repos","events_url":"https://api.github.com/users/zotero/events{/privacy}","received_events_url":"https://api.github.com/users/zotero/received_events","type":"Organization","site_admin":false},"repo":{"id":1991863,"name":"translators","full_name":"zotero/translators","owner":{"login":"zotero","id":891917,"avatar_url":"https://avatars.githubusercontent.com/u/891917?v=3","gravatar_id":"","url":"https://api.github.com/users/zotero","html_url":"https://github.com/zotero","followers_url":"https://api.github.com/users/zotero/followers","following_url":"https://api.github.com/users/zotero/following{/other_user}","gists_url":"https://api.github.com/users/zotero/gists{/gist_id}","starred_url":"https://api.github.com/users/zotero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zotero/subscriptions","organizations_url":"https://api.github.com/users/zotero/orgs","repos_url":"https://api.github.com/users/zotero/repos","events_url":"https://api.github.com/users/zotero/events{/privacy}","received_events_url":"https://api.github.com/users/zotero/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zotero/translators","description":"Zotero Translators","fork":false,"url":"https://api.github.com/repos/zotero/translators","forks_url":"https://api.github.com/repos/zotero/translators/forks","keys_url":"https://api.github.com/repos/zotero/translators/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zotero/translators/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zotero/translators/teams","hooks_url":"https://api.github.com/repos/zotero/translators/hooks","issue_events_url":"https://api.github.com/repos/zotero/translators/issues/events{/number}","events_url":"https://api.github.com/repos/zotero/translators/events","assignees_url":"https://api.github.com/repos/zotero/translators/assignees{/user}","branches_url":"https://api.github.com/repos/zotero/translators/branches{/branch}","tags_url":"https://api.github.com/repos/zotero/translators/tags","blobs_url":"https://api.github.com/repos/zotero/translators/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zotero/translators/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zotero/translators/git/refs{/sha}","trees_url":"https://api.github.com/repos/zotero/translators/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zotero/translators/statuses/{sha}","languages_url":"https://api.github.com/repos/zotero/translators/languages","stargazers_url":"https://api.github.com/repos/zotero/translators/stargazers","contributors_url":"https://api.github.com/repos/zotero/translators/contributors","subscribers_url":"https://api.github.com/repos/zotero/translators/subscribers","subscription_url":"https://api.github.com/repos/zotero/translators/subscription","commits_url":"https://api.github.com/repos/zotero/translators/commits{/sha}","git_commits_url":"https://api.github.com/repos/zotero/translators/git/commits{/sha}","comments_url":"https://api.github.com/repos/zotero/translators/comments{/number}","issue_comment_url":"https://api.github.com/repos/zotero/translators/issues/comments{/number}","contents_url":"https://api.github.com/repos/zotero/translators/contents/{+path}","compare_url":"https://api.github.com/repos/zotero/translators/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zotero/translators/merges","archive_url":"https://api.github.com/repos/zotero/translators/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zotero/translators/downloads","issues_url":"https://api.github.com/repos/zotero/translators/issues{/number}","pulls_url":"https://api.github.com/repos/zotero/translators/pulls{/number}","milestones_url":"https://api.github.com/repos/zotero/translators/milestones{/number}","notifications_url":"https://api.github.com/repos/zotero/translators/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zotero/translators/labels{/name}","releases_url":"https://api.github.com/repos/zotero/translators/releases{/id}","created_at":"2011-07-03T17:40:38Z","updated_at":"2016-01-04T20:25:52Z","pushed_at":"2016-01-06T16:22:54Z","git_url":"git://github.com/zotero/translators.git","ssh_url":"git@github.com:zotero/translators.git","clone_url":"https://github.com/zotero/translators.git","svn_url":"https://github.com/zotero/translators","homepage":"http://www.zotero.org/support/dev/translators","size":13283,"stargazers_count":161,"watchers_count":161,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":146,"mirror_url":null,"open_issues_count":143,"forks":146,"open_issues":143,"watchers":161,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zotero/translators/pulls/996"},"html":{"href":"https://github.com/zotero/translators/pull/996"},"issue":{"href":"https://api.github.com/repos/zotero/translators/issues/996"},"comments":{"href":"https://api.github.com/repos/zotero/translators/issues/996/comments"},"review_comments":{"href":"https://api.github.com/repos/zotero/translators/pulls/996/comments"},"review_comment":{"href":"https://api.github.com/repos/zotero/translators/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zotero/translators/pulls/996/commits"},"statuses":{"href":"https://api.github.com/repos/zotero/translators/statuses/f6d6ed73c2a645d693ad6c0f38241afdf4519921"}}}}