{"action":"created","comment":{"url":"https://api.github.com/repos/MITLibraries/bento/pulls/comments/129862994","pull_request_review_id":52680271,"id":129862994,"diff_hunk":"@@ -31,27 +36,33 @@ def record_to_hints(record)\n     fingerprint_alt_titles(740, record)\n   end\n \n+  # Creates a Hint for each alternate title\n   def fingerprint_alt_titles(field, record)\n     alt_title(field, record).each do |hint|\n       Hint.create(title: title(record), url: url(record),\n                   fingerprint: Hint.fingerprint(hint))\n     end\n   end\n \n+  # Extracts title from marc 245\n   def title(record)\n     extract_marc_value(245, 'a', record).text\n   end\n \n+  # Extracts array of alternate titles from supplied tag (246 and 740)\n   def alt_title(tag, record)\n     extract_marc_value(tag, 'a', record).map(&:text)\n   end\n \n+  # Generic marc tag / subfield parser\n   def extract_marc_value(tag, subfield, record)\n     record.xpath(\n       \"./xmlns:datafield[@tag=#{tag}]/xmlns:subfield[@code=\\\"#{subfield}\\\"]\"\n     )\n   end\n \n+  # For some reason, we sometimes use the standard 866$u for URLs but other\n+  # times use 956$u. :facepunch:","path":"app/models/aleph_hint.rb","position":null,"original_position":60,"commit_id":"8eabc27c555333397a8b62617e6684ef38170acd","original_commit_id":"ecb3b70287d409e6f48474ddea1b4627d5d53654","user":{"login":"JPrevost","id":1386650,"avatar_url":"https://avatars2.githubusercontent.com/u/1386650?v=4","gravatar_id":"","url":"https://api.github.com/users/JPrevost","html_url":"https://github.com/JPrevost","followers_url":"https://api.github.com/users/JPrevost/followers","following_url":"https://api.github.com/users/JPrevost/following{/other_user}","gists_url":"https://api.github.com/users/JPrevost/gists{/gist_id}","starred_url":"https://api.github.com/users/JPrevost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JPrevost/subscriptions","organizations_url":"https://api.github.com/users/JPrevost/orgs","repos_url":"https://api.github.com/users/JPrevost/repos","events_url":"https://api.github.com/users/JPrevost/events{/privacy}","received_events_url":"https://api.github.com/users/JPrevost/received_events","type":"User","site_admin":false},"body":"noted. I concur and will adjust accordingly. thx.","created_at":"2017-07-27T14:48:00Z","updated_at":"2017-07-27T14:48:01Z","html_url":"https://github.com/MITLibraries/bento/pull/228#discussion_r129862994","pull_request_url":"https://api.github.com/repos/MITLibraries/bento/pulls/228","_links":{"self":{"href":"https://api.github.com/repos/MITLibraries/bento/pulls/comments/129862994"},"html":{"href":"https://github.com/MITLibraries/bento/pull/228#discussion_r129862994"},"pull_request":{"href":"https://api.github.com/repos/MITLibraries/bento/pulls/228"}}},"pull_request":{"url":"https://api.github.com/repos/MITLibraries/bento/pulls/228","id":131827469,"html_url":"https://github.com/MITLibraries/bento/pull/228","diff_url":"https://github.com/MITLibraries/bento/pull/228.diff","patch_url":"https://github.com/MITLibraries/bento/pull/228.patch","issue_url":"https://api.github.com/repos/MITLibraries/bento/issues/228","number":228,"state":"open","locked":false,"title":"Loads Hints from web accessible marcxml","user":{"login":"JPrevost","id":1386650,"avatar_url":"https://avatars2.githubusercontent.com/u/1386650?v=4","gravatar_id":"","url":"https://api.github.com/users/JPrevost","html_url":"https://github.com/JPrevost","followers_url":"https://api.github.com/users/JPrevost/followers","following_url":"https://api.github.com/users/JPrevost/following{/other_user}","gists_url":"https://api.github.com/users/JPrevost/gists{/gist_id}","starred_url":"https://api.github.com/users/JPrevost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JPrevost/subscriptions","organizations_url":"https://api.github.com/users/JPrevost/orgs","repos_url":"https://api.github.com/users/JPrevost/repos","events_url":"https://api.github.com/users/JPrevost/events{/privacy}","received_events_url":"https://api.github.com/users/JPrevost/received_events","type":"User","site_admin":false},"body":"## Status\r\n**READY**\r\n\r\n#### What does this PR do?\r\n\r\n* loads hints from web accessible marcxml\r\n* fingerprints are generated from title and alt title fields\r\n\r\n#### How can a reviewer manually see the effects of these changes?\r\n\r\nAfter setting an appropriate value for `ALEPH_HINT_SOURCE` (see LastPass or Heroku directly) you can:\r\n\r\n```\r\nheroku local:run rails console\r\nHint.count (observe small number)\r\nAlephHint.new.process_records\r\n(wait)\r\nHint.count (observe much larger number)\r\n```\r\n\r\n#### What are the relevant tickets?\r\n- https://mitlibraries.atlassian.net/browse/DI-445\r\n\r\n#### Todo:\r\n- [x] Tests\r\n- [x] Documentation\r\n- [ ] Stakeholder approval\r\n\r\n#### Requires Database Migrations?\r\nNO\r\n\r\n#### Includes new or updated dependencies?\r\nYES, but not a gem dependency. In this case, `ALEPH_HINT_SOURCE` has been added to ENV","created_at":"2017-07-21T18:01:05Z","updated_at":"2017-07-27T14:48:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9e9ae0a79a77a5c2852e749c9221275abff17cc","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/MITLibraries/bento/pulls/228/commits","review_comments_url":"https://api.github.com/repos/MITLibraries/bento/pulls/228/comments","review_comment_url":"https://api.github.com/repos/MITLibraries/bento/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MITLibraries/bento/issues/228/comments","statuses_url":"https://api.github.com/repos/MITLibraries/bento/statuses/8eabc27c555333397a8b62617e6684ef38170acd","head":{"label":"MITLibraries:445_aleph_fingerprints","ref":"445_aleph_fingerprints","sha":"8eabc27c555333397a8b62617e6684ef38170acd","user":{"login":"MITLibraries","id":2176469,"avatar_url":"https://avatars1.githubusercontent.com/u/2176469?v=4","gravatar_id":"","url":"https://api.github.com/users/MITLibraries","html_url":"https://github.com/MITLibraries","followers_url":"https://api.github.com/users/MITLibraries/followers","following_url":"https://api.github.com/users/MITLibraries/following{/other_user}","gists_url":"https://api.github.com/users/MITLibraries/gists{/gist_id}","starred_url":"https://api.github.com/users/MITLibraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MITLibraries/subscriptions","organizations_url":"https://api.github.com/users/MITLibraries/orgs","repos_url":"https://api.github.com/users/MITLibraries/repos","events_url":"https://api.github.com/users/MITLibraries/events{/privacy}","received_events_url":"https://api.github.com/users/MITLibraries/received_events","type":"Organization","site_admin":false},"repo":{"id":63443356,"name":"bento","full_name":"MITLibraries/bento","owner":{"login":"MITLibraries","id":2176469,"avatar_url":"https://avatars1.githubusercontent.com/u/2176469?v=4","gravatar_id":"","url":"https://api.github.com/users/MITLibraries","html_url":"https://github.com/MITLibraries","followers_url":"https://api.github.com/users/MITLibraries/followers","following_url":"https://api.github.com/users/MITLibraries/following{/other_user}","gists_url":"https://api.github.com/users/MITLibraries/gists{/gist_id}","starred_url":"https://api.github.com/users/MITLibraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MITLibraries/subscriptions","organizations_url":"https://api.github.com/users/MITLibraries/orgs","repos_url":"https://api.github.com/users/MITLibraries/repos","events_url":"https://api.github.com/users/MITLibraries/events{/privacy}","received_events_url":"https://api.github.com/users/MITLibraries/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MITLibraries/bento","description":null,"fork":false,"url":"https://api.github.com/repos/MITLibraries/bento","forks_url":"https://api.github.com/repos/MITLibraries/bento/forks","keys_url":"https://api.github.com/repos/MITLibraries/bento/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MITLibraries/bento/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MITLibraries/bento/teams","hooks_url":"https://api.github.com/repos/MITLibraries/bento/hooks","issue_events_url":"https://api.github.com/repos/MITLibraries/bento/issues/events{/number}","events_url":"https://api.github.com/repos/MITLibraries/bento/events","assignees_url":"https://api.github.com/repos/MITLibraries/bento/assignees{/user}","branches_url":"https://api.github.com/repos/MITLibraries/bento/branches{/branch}","tags_url":"https://api.github.com/repos/MITLibraries/bento/tags","blobs_url":"https://api.github.com/repos/MITLibraries/bento/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MITLibraries/bento/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MITLibraries/bento/git/refs{/sha}","trees_url":"https://api.github.com/repos/MITLibraries/bento/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MITLibraries/bento/statuses/{sha}","languages_url":"https://api.github.com/repos/MITLibraries/bento/languages","stargazers_url":"https://api.github.com/repos/MITLibraries/bento/stargazers","contributors_url":"https://api.github.com/repos/MITLibraries/bento/contributors","subscribers_url":"https://api.github.com/repos/MITLibraries/bento/subscribers","subscription_url":"https://api.github.com/repos/MITLibraries/bento/subscription","commits_url":"https://api.github.com/repos/MITLibraries/bento/commits{/sha}","git_commits_url":"https://api.github.com/repos/MITLibraries/bento/git/commits{/sha}","comments_url":"https://api.github.com/repos/MITLibraries/bento/comments{/number}","issue_comment_url":"https://api.github.com/repos/MITLibraries/bento/issues/comments{/number}","contents_url":"https://api.github.com/repos/MITLibraries/bento/contents/{+path}","compare_url":"https://api.github.com/repos/MITLibraries/bento/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MITLibraries/bento/merges","archive_url":"https://api.github.com/repos/MITLibraries/bento/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MITLibraries/bento/downloads","issues_url":"https://api.github.com/repos/MITLibraries/bento/issues{/number}","pulls_url":"https://api.github.com/repos/MITLibraries/bento/pulls{/number}","milestones_url":"https://api.github.com/repos/MITLibraries/bento/milestones{/number}","notifications_url":"https://api.github.com/repos/MITLibraries/bento/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MITLibraries/bento/labels{/name}","releases_url":"https://api.github.com/repos/MITLibraries/bento/releases{/id}","deployments_url":"https://api.github.com/repos/MITLibraries/bento/deployments","created_at":"2016-07-15T18:37:03Z","updated_at":"2017-06-14T18:29:34Z","pushed_at":"2017-07-26T20:54:39Z","git_url":"git://github.com/MITLibraries/bento.git","ssh_url":"git@github.com:MITLibraries/bento.git","clone_url":"https://github.com/MITLibraries/bento.git","svn_url":"https://github.com/MITLibraries/bento","homepage":null,"size":702,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":3,"default_branch":"master"}},"base":{"label":"MITLibraries:master","ref":"master","sha":"4631a9a53c4721cff6e5ddacf016d1e57332cd4b","user":{"login":"MITLibraries","id":2176469,"avatar_url":"https://avatars1.githubusercontent.com/u/2176469?v=4","gravatar_id":"","url":"https://api.github.com/users/MITLibraries","html_url":"https://github.com/MITLibraries","followers_url":"https://api.github.com/users/MITLibraries/followers","following_url":"https://api.github.com/users/MITLibraries/following{/other_user}","gists_url":"https://api.github.com/users/MITLibraries/gists{/gist_id}","starred_url":"https://api.github.com/users/MITLibraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MITLibraries/subscriptions","organizations_url":"https://api.github.com/users/MITLibraries/orgs","repos_url":"https://api.github.com/users/MITLibraries/repos","events_url":"https://api.github.com/users/MITLibraries/events{/privacy}","received_events_url":"https://api.github.com/users/MITLibraries/received_events","type":"Organization","site_admin":false},"repo":{"id":63443356,"name":"bento","full_name":"MITLibraries/bento","owner":{"login":"MITLibraries","id":2176469,"avatar_url":"https://avatars1.githubusercontent.com/u/2176469?v=4","gravatar_id":"","url":"https://api.github.com/users/MITLibraries","html_url":"https://github.com/MITLibraries","followers_url":"https://api.github.com/users/MITLibraries/followers","following_url":"https://api.github.com/users/MITLibraries/following{/other_user}","gists_url":"https://api.github.com/users/MITLibraries/gists{/gist_id}","starred_url":"https://api.github.com/users/MITLibraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MITLibraries/subscriptions","organizations_url":"https://api.github.com/users/MITLibraries/orgs","repos_url":"https://api.github.com/users/MITLibraries/repos","events_url":"https://api.github.com/users/MITLibraries/events{/privacy}","received_events_url":"https://api.github.com/users/MITLibraries/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MITLibraries/bento","description":null,"fork":false,"url":"https://api.github.com/repos/MITLibraries/bento","forks_url":"https://api.github.com/repos/MITLibraries/bento/forks","keys_url":"https://api.github.com/repos/MITLibraries/bento/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MITLibraries/bento/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MITLibraries/bento/teams","hooks_url":"https://api.github.com/repos/MITLibraries/bento/hooks","issue_events_url":"https://api.github.com/repos/MITLibraries/bento/issues/events{/number}","events_url":"https://api.github.com/repos/MITLibraries/bento/events","assignees_url":"https://api.github.com/repos/MITLibraries/bento/assignees{/user}","branches_url":"https://api.github.com/repos/MITLibraries/bento/branches{/branch}","tags_url":"https://api.github.com/repos/MITLibraries/bento/tags","blobs_url":"https://api.github.com/repos/MITLibraries/bento/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MITLibraries/bento/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MITLibraries/bento/git/refs{/sha}","trees_url":"https://api.github.com/repos/MITLibraries/bento/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MITLibraries/bento/statuses/{sha}","languages_url":"https://api.github.com/repos/MITLibraries/bento/languages","stargazers_url":"https://api.github.com/repos/MITLibraries/bento/stargazers","contributors_url":"https://api.github.com/repos/MITLibraries/bento/contributors","subscribers_url":"https://api.github.com/repos/MITLibraries/bento/subscribers","subscription_url":"https://api.github.com/repos/MITLibraries/bento/subscription","commits_url":"https://api.github.com/repos/MITLibraries/bento/commits{/sha}","git_commits_url":"https://api.github.com/repos/MITLibraries/bento/git/commits{/sha}","comments_url":"https://api.github.com/repos/MITLibraries/bento/comments{/number}","issue_comment_url":"https://api.github.com/repos/MITLibraries/bento/issues/comments{/number}","contents_url":"https://api.github.com/repos/MITLibraries/bento/contents/{+path}","compare_url":"https://api.github.com/repos/MITLibraries/bento/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MITLibraries/bento/merges","archive_url":"https://api.github.com/repos/MITLibraries/bento/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MITLibraries/bento/downloads","issues_url":"https://api.github.com/repos/MITLibraries/bento/issues{/number}","pulls_url":"https://api.github.com/repos/MITLibraries/bento/pulls{/number}","milestones_url":"https://api.github.com/repos/MITLibraries/bento/milestones{/number}","notifications_url":"https://api.github.com/repos/MITLibraries/bento/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MITLibraries/bento/labels{/name}","releases_url":"https://api.github.com/repos/MITLibraries/bento/releases{/id}","deployments_url":"https://api.github.com/repos/MITLibraries/bento/deployments","created_at":"2016-07-15T18:37:03Z","updated_at":"2017-06-14T18:29:34Z","pushed_at":"2017-07-26T20:54:39Z","git_url":"git://github.com/MITLibraries/bento.git","ssh_url":"git@github.com:MITLibraries/bento.git","clone_url":"https://github.com/MITLibraries/bento.git","svn_url":"https://github.com/MITLibraries/bento","homepage":null,"size":702,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MITLibraries/bento/pulls/228"},"html":{"href":"https://github.com/MITLibraries/bento/pull/228"},"issue":{"href":"https://api.github.com/repos/MITLibraries/bento/issues/228"},"comments":{"href":"https://api.github.com/repos/MITLibraries/bento/issues/228/comments"},"review_comments":{"href":"https://api.github.com/repos/MITLibraries/bento/pulls/228/comments"},"review_comment":{"href":"https://api.github.com/repos/MITLibraries/bento/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MITLibraries/bento/pulls/228/commits"},"statuses":{"href":"https://api.github.com/repos/MITLibraries/bento/statuses/8eabc27c555333397a8b62617e6684ef38170acd"}}}}
{"actor":{"display_login":"JPrevost"}}