{"action":"created","comment":{"url":"https://api.github.com/repos/zotero/translators/pulls/comments/49072078","id":49072078,"diff_hunk":"@@ -93,25 +96,28 @@ function completeDOIs(doc) {\n \t}\n }\n \n-function retrieveDOIs(DOIs, doc) {\n+function retrieveDOIs(DOIs, doc, provider) {","path":"DOI.js","position":23,"original_position":23,"commit_id":"fd1207833e8a5c94bfeb84ab06298980ec505f1f","original_commit_id":"fd1207833e8a5c94bfeb84ab06298980ec505f1f","user":{"login":"aurimasv","id":1381759,"avatar_url":"https://avatars.githubusercontent.com/u/1381759?v=3","gravatar_id":"","url":"https://api.github.com/users/aurimasv","html_url":"https://github.com/aurimasv","followers_url":"https://api.github.com/users/aurimasv/followers","following_url":"https://api.github.com/users/aurimasv/following{/other_user}","gists_url":"https://api.github.com/users/aurimasv/gists{/gist_id}","starred_url":"https://api.github.com/users/aurimasv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aurimasv/subscriptions","organizations_url":"https://api.github.com/users/aurimasv/orgs","repos_url":"https://api.github.com/users/aurimasv/repos","events_url":"https://api.github.com/users/aurimasv/events{/privacy}","received_events_url":"https://api.github.com/users/aurimasv/received_events","type":"User","site_admin":false},"body":"I would make `provider` into `providers` and have that be an array containing translator IDs that should be used for DOIs. On each iteration of `retrieveDOIs` you would `.shift` the translator ID to use in `.setTranslator` until you run out of IDs. IMO that would make this simpler.","created_at":"2016-01-07T13:27:26Z","updated_at":"2016-01-07T13:27:26Z","html_url":"https://github.com/zotero/translators/pull/984#discussion_r49072078","pull_request_url":"https://api.github.com/repos/zotero/translators/pulls/984","_links":{"self":{"href":"https://api.github.com/repos/zotero/translators/pulls/comments/49072078"},"html":{"href":"https://github.com/zotero/translators/pull/984#discussion_r49072078"},"pull_request":{"href":"https://api.github.com/repos/zotero/translators/pulls/984"}}},"pull_request":{"url":"https://api.github.com/repos/zotero/translators/pulls/984","id":54691342,"html_url":"https://github.com/zotero/translators/pull/984","diff_url":"https://github.com/zotero/translators/pull/984.diff","patch_url":"https://github.com/zotero/translators/pull/984.patch","issue_url":"https://api.github.com/repos/zotero/translators/issues/984","number":984,"state":"open","locked":false,"title":"DOI translator checks DataCite as well (test)","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":"I tried to expand the DOI translator to handle calling besides the CrossRef translator also the DataCite translator. I know that there is an old PR #632 and much more discussion how this could be achieved...\r\n\r\nMy approach in the `retrieveDOIs` function is just before calling the `completeDOIs` function to recursively call the `retrieveDOIs` function again but using the DataCite translator with the `remainingDOIs` (and make sure we don't create an infinite loop). Actually, this seemed to work pretty well, but maybe I am missing some things here.\r\n\r\nMy test case is the webpage: http://www.egms.de/static/de/journals/mbi/2015-15/mbi000336.shtml with 6 CrossRef doi's and 1 DataCite doi. Actually, the DataCite doi works as expected, but only the last CrossRef doi is recognized. However, I think that this behaviour is not a new bug but it is the same with the current translator. (Check). I tried to code another (non-asynchronous) version `retrieveDOIs2` which works fine for several CrossRef/DataCite doi's.\r\n\r\nI am looking forward for your comments. Is this some idea which is worth to continue? Is it working for you?","created_at":"2015-12-28T23:18:17Z","updated_at":"2016-01-07T13:27:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e3bbcc58ac74a0dc321249d8f3b7204dc90f9ce","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zotero/translators/pulls/984/commits","review_comments_url":"https://api.github.com/repos/zotero/translators/pulls/984/comments","review_comment_url":"https://api.github.com/repos/zotero/translators/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zotero/translators/issues/984/comments","statuses_url":"https://api.github.com/repos/zotero/translators/statuses/fd1207833e8a5c94bfeb84ab06298980ec505f1f","head":{"label":"zuphilip:doi-test","ref":"doi-test","sha":"fd1207833e8a5c94bfeb84ab06298980ec505f1f","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:55:51Z","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":11938,"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":"9122ae2b59c185f65b1325ec6ffb5dfc4eec0c2b","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:52:26Z","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":13266,"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":141,"forks":146,"open_issues":141,"watchers":161,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zotero/translators/pulls/984"},"html":{"href":"https://github.com/zotero/translators/pull/984"},"issue":{"href":"https://api.github.com/repos/zotero/translators/issues/984"},"comments":{"href":"https://api.github.com/repos/zotero/translators/issues/984/comments"},"review_comments":{"href":"https://api.github.com/repos/zotero/translators/pulls/984/comments"},"review_comment":{"href":"https://api.github.com/repos/zotero/translators/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zotero/translators/pulls/984/commits"},"statuses":{"href":"https://api.github.com/repos/zotero/translators/statuses/fd1207833e8a5c94bfeb84ab06298980ec505f1f"}}}}