{"action":"created","comment":{"url":"https://api.github.com/repos/feedforce/ruboty-sebastian/pulls/comments/36404083","id":36404083,"diff_hunk":"@@ -16,12 +16,14 @@ def get_event_from_cityhall\n \n     {title: title, url: url+fragment}\n   end\n- \n+\n   def get_event_from_dome\n     url = \"http://www.tokyo-dome.co.jp/dome/schedule/\"\n     doc = Nokogiri::HTML.parse(open(url).read.force_encoding('UTF-8'))\n \n-    column = doc.xpath(\"//th[contains(./text(), '#{now.day}日')]/following-sibling::*\").xpath(\".//p\")\n+    column = doc.xpath(\"//th[contains(./text(), '#{now.day}日')]/..\").\n+      select{|c| c.xpath(\"./th\").text.strip.match(/\\A#{now.day}日/) }.","path":"lib/ruboty/actions/get_event.rb","position":22,"original_position":22,"commit_id":"15fd323ac167f316581e501bbf3092ac33c6a69a","original_commit_id":"15fd323ac167f316581e501bbf3092ac33c6a69a","user":{"login":"TasukuNakano","id":1913131,"avatar_url":"https://avatars.githubusercontent.com/u/1913131?v=3","gravatar_id":"","url":"https://api.github.com/users/TasukuNakano","html_url":"https://github.com/TasukuNakano","followers_url":"https://api.github.com/users/TasukuNakano/followers","following_url":"https://api.github.com/users/TasukuNakano/following{/other_user}","gists_url":"https://api.github.com/users/TasukuNakano/gists{/gist_id}","starred_url":"https://api.github.com/users/TasukuNakano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TasukuNakano/subscriptions","organizations_url":"https://api.github.com/users/TasukuNakano/orgs","repos_url":"https://api.github.com/users/TasukuNakano/repos","events_url":"https://api.github.com/users/TasukuNakano/events{/privacy}","received_events_url":"https://api.github.com/users/TasukuNakano/received_events","type":"User","site_admin":false},"body":"確かに正規表現でマッチさせるしか浮かばないですねぇ…","created_at":"2015-08-06T11:29:57Z","updated_at":"2015-08-06T11:29:57Z","html_url":"https://github.com/feedforce/ruboty-sebastian/pull/24#discussion_r36404083","pull_request_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/feedforce/ruboty-sebastian/pulls/comments/36404083"},"html":{"href":"https://github.com/feedforce/ruboty-sebastian/pull/24#discussion_r36404083"},"pull_request":{"href":"https://api.github.com/repos/feedforce/ruboty-sebastian/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/feedforce/ruboty-sebastian/pulls/24","id":41776263,"html_url":"https://github.com/feedforce/ruboty-sebastian/pull/24","diff_url":"https://github.com/feedforce/ruboty-sebastian/pull/24.diff","patch_url":"https://github.com/feedforce/ruboty-sebastian/pull/24.patch","issue_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/issues/24","number":24,"state":"open","locked":false,"title":"東京ドームのほかの日のイベントをお知らせしてしまう件","user":{"login":"kano-e","id":2674819,"avatar_url":"https://avatars.githubusercontent.com/u/2674819?v=3","gravatar_id":"","url":"https://api.github.com/users/kano-e","html_url":"https://github.com/kano-e","followers_url":"https://api.github.com/users/kano-e/followers","following_url":"https://api.github.com/users/kano-e/following{/other_user}","gists_url":"https://api.github.com/users/kano-e/gists{/gist_id}","starred_url":"https://api.github.com/users/kano-e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kano-e/subscriptions","organizations_url":"https://api.github.com/users/kano-e/orgs","repos_url":"https://api.github.com/users/kano-e/repos","events_url":"https://api.github.com/users/kano-e/events{/privacy}","received_events_url":"https://api.github.com/users/kano-e/received_events","type":"User","site_admin":false},"body":"### 事象\r\n\r\n8/6 に 8/16 のイベントをお知らせしていた。\r\n\r\n### 問題点\r\n\r\n* 日付が一桁\r\n* 当日のイベントがなく\r\n* 同じ月の一の位の数が同じ日にイベントがある\r\n\r\n場合に、それを拾って告知してしまう。\r\n\r\n### 原因\r\n\r\n`doc.xpath(\"//th[contains(./text(), '#{now.day}日')]/following-sibling::*\")` という xpath で拾っているが `contains` は部分一致なので `6日` には `16日` `26日` なども拾ってしまう。\r\n\r\n```\r\n> column = doc.xpath(\"//th[contains(./text(), '#{now.day}日')]\").text\r\n=> \"6日（木）\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t16日（日）\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t26日（水）\"\r\n```\r\n","created_at":"2015-08-06T11:09:43Z","updated_at":"2015-08-06T11:29:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"acd191f19825e8d35d36df5cd70f9b94f94dec31","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/pulls/24/commits","review_comments_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/pulls/24/comments","review_comment_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/pulls/comments{/number}","comments_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/issues/24/comments","statuses_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/statuses/15fd323ac167f316581e501bbf3092ac33c6a69a","head":{"label":"feedforce:single-digits","ref":"single-digits","sha":"15fd323ac167f316581e501bbf3092ac33c6a69a","user":{"login":"feedforce","id":4169389,"avatar_url":"https://avatars.githubusercontent.com/u/4169389?v=3","gravatar_id":"","url":"https://api.github.com/users/feedforce","html_url":"https://github.com/feedforce","followers_url":"https://api.github.com/users/feedforce/followers","following_url":"https://api.github.com/users/feedforce/following{/other_user}","gists_url":"https://api.github.com/users/feedforce/gists{/gist_id}","starred_url":"https://api.github.com/users/feedforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedforce/subscriptions","organizations_url":"https://api.github.com/users/feedforce/orgs","repos_url":"https://api.github.com/users/feedforce/repos","events_url":"https://api.github.com/users/feedforce/events{/privacy}","received_events_url":"https://api.github.com/users/feedforce/received_events","type":"Organization","site_admin":false},"repo":{"id":35537443,"name":"ruboty-sebastian","full_name":"feedforce/ruboty-sebastian","owner":{"login":"feedforce","id":4169389,"avatar_url":"https://avatars.githubusercontent.com/u/4169389?v=3","gravatar_id":"","url":"https://api.github.com/users/feedforce","html_url":"https://github.com/feedforce","followers_url":"https://api.github.com/users/feedforce/followers","following_url":"https://api.github.com/users/feedforce/following{/other_user}","gists_url":"https://api.github.com/users/feedforce/gists{/gist_id}","starred_url":"https://api.github.com/users/feedforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedforce/subscriptions","organizations_url":"https://api.github.com/users/feedforce/orgs","repos_url":"https://api.github.com/users/feedforce/repos","events_url":"https://api.github.com/users/feedforce/events{/privacy}","received_events_url":"https://api.github.com/users/feedforce/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/feedforce/ruboty-sebastian","description":"","fork":false,"url":"https://api.github.com/repos/feedforce/ruboty-sebastian","forks_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/forks","keys_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/keys{/key_id}","collaborators_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/teams","hooks_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/hooks","issue_events_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/issues/events{/number}","events_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/events","assignees_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/assignees{/user}","branches_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/branches{/branch}","tags_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/tags","blobs_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/git/refs{/sha}","trees_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/git/trees{/sha}","statuses_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/statuses/{sha}","languages_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/languages","stargazers_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/stargazers","contributors_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/contributors","subscribers_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/subscribers","subscription_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/subscription","commits_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/commits{/sha}","git_commits_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/git/commits{/sha}","comments_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/comments{/number}","issue_comment_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/issues/comments{/number}","contents_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/contents/{+path}","compare_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/compare/{base}...{head}","merges_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/merges","archive_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/downloads","issues_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/issues{/number}","pulls_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/pulls{/number}","milestones_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/milestones{/number}","notifications_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/labels{/name}","releases_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/releases{/id}","created_at":"2015-05-13T08:33:01Z","updated_at":"2015-05-19T08:54:05Z","pushed_at":"2015-08-06T11:09:44Z","git_url":"git://github.com/feedforce/ruboty-sebastian.git","ssh_url":"git@github.com:feedforce/ruboty-sebastian.git","clone_url":"https://github.com/feedforce/ruboty-sebastian.git","svn_url":"https://github.com/feedforce/ruboty-sebastian","homepage":null,"size":452,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"feedforce:master","ref":"master","sha":"23cb39c831f957775a2ad553824218616a343de0","user":{"login":"feedforce","id":4169389,"avatar_url":"https://avatars.githubusercontent.com/u/4169389?v=3","gravatar_id":"","url":"https://api.github.com/users/feedforce","html_url":"https://github.com/feedforce","followers_url":"https://api.github.com/users/feedforce/followers","following_url":"https://api.github.com/users/feedforce/following{/other_user}","gists_url":"https://api.github.com/users/feedforce/gists{/gist_id}","starred_url":"https://api.github.com/users/feedforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedforce/subscriptions","organizations_url":"https://api.github.com/users/feedforce/orgs","repos_url":"https://api.github.com/users/feedforce/repos","events_url":"https://api.github.com/users/feedforce/events{/privacy}","received_events_url":"https://api.github.com/users/feedforce/received_events","type":"Organization","site_admin":false},"repo":{"id":35537443,"name":"ruboty-sebastian","full_name":"feedforce/ruboty-sebastian","owner":{"login":"feedforce","id":4169389,"avatar_url":"https://avatars.githubusercontent.com/u/4169389?v=3","gravatar_id":"","url":"https://api.github.com/users/feedforce","html_url":"https://github.com/feedforce","followers_url":"https://api.github.com/users/feedforce/followers","following_url":"https://api.github.com/users/feedforce/following{/other_user}","gists_url":"https://api.github.com/users/feedforce/gists{/gist_id}","starred_url":"https://api.github.com/users/feedforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedforce/subscriptions","organizations_url":"https://api.github.com/users/feedforce/orgs","repos_url":"https://api.github.com/users/feedforce/repos","events_url":"https://api.github.com/users/feedforce/events{/privacy}","received_events_url":"https://api.github.com/users/feedforce/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/feedforce/ruboty-sebastian","description":"","fork":false,"url":"https://api.github.com/repos/feedforce/ruboty-sebastian","forks_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/forks","keys_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/keys{/key_id}","collaborators_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/teams","hooks_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/hooks","issue_events_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/issues/events{/number}","events_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/events","assignees_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/assignees{/user}","branches_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/branches{/branch}","tags_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/tags","blobs_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/git/refs{/sha}","trees_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/git/trees{/sha}","statuses_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/statuses/{sha}","languages_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/languages","stargazers_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/stargazers","contributors_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/contributors","subscribers_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/subscribers","subscription_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/subscription","commits_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/commits{/sha}","git_commits_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/git/commits{/sha}","comments_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/comments{/number}","issue_comment_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/issues/comments{/number}","contents_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/contents/{+path}","compare_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/compare/{base}...{head}","merges_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/merges","archive_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/downloads","issues_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/issues{/number}","pulls_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/pulls{/number}","milestones_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/milestones{/number}","notifications_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/labels{/name}","releases_url":"https://api.github.com/repos/feedforce/ruboty-sebastian/releases{/id}","created_at":"2015-05-13T08:33:01Z","updated_at":"2015-05-19T08:54:05Z","pushed_at":"2015-08-06T11:09:44Z","git_url":"git://github.com/feedforce/ruboty-sebastian.git","ssh_url":"git@github.com:feedforce/ruboty-sebastian.git","clone_url":"https://github.com/feedforce/ruboty-sebastian.git","svn_url":"https://github.com/feedforce/ruboty-sebastian","homepage":null,"size":452,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/feedforce/ruboty-sebastian/pulls/24"},"html":{"href":"https://github.com/feedforce/ruboty-sebastian/pull/24"},"issue":{"href":"https://api.github.com/repos/feedforce/ruboty-sebastian/issues/24"},"comments":{"href":"https://api.github.com/repos/feedforce/ruboty-sebastian/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/feedforce/ruboty-sebastian/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/feedforce/ruboty-sebastian/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/feedforce/ruboty-sebastian/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/feedforce/ruboty-sebastian/statuses/15fd323ac167f316581e501bbf3092ac33c6a69a"}}}}