{"action":"created","comment":{"url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments/43759499","id":43759499,"diff_hunk":"@@ -0,0 +1,63 @@\n+require 'mechanize'\n+require 'set'\n+class Opinion\n+  def initialize lecturers_set\n+    @lecturers_set = lecturers_set\n+    @mechanize = Mechanize.new\n+    @name_to_link = {}\n+    @name_to_opinions = {}\n+  end\n+\n+  def links_to_opinions\n+    page = @mechanize.get('http://bsuir-helper.ru/lectors')\n+    rows = page.parser.css(\"div [class='view view-lectors view-style-Нормальный view-id-lectors view-display-id-page_1'] a\")\n+    rows.each do |row|\n+      a = row.text.split(' ')\n+      name = String.new(\"\" << a[0] << ' ' << a[1][0] << '.' << ' ' << a[2][0] << '.')\n+      if @lecturers_set.include?(name)\n+        @name_to_link[name] = \"http://bsuir-helper.ru#{row['href']}\"\n+      end\n+    end\n+  end\n+\n+  def opinions\n+<<<<<<< HEAD\n+    name_to_opinions = {}\n+    @name_to_link.each do |name, link| \n+=======\n+    @name_to_link.each do |name, link|\n+>>>>>>> f1c6eda... homework 3\n+      opinion_page = @mechanize.get(link)\n+      dates = []\n+      comments = []\n+      rows_date = opinion_page.parser.css(\"div [class='submitted']\")\n+      rows_date.each do |row| \n+        dates << row.css(\"span\")[1].text\n+      end\n+      rows_comment = opinion_page.parser.css(\"div [id='comments']\").css(\"div [class='content']\")\n+      rows_comment.each do |row|\n+        comments << row.css(\"p\").text \n+      end\n+<<<<<<< HEAD\n+      0.upto(dates.length - 1) do |i|\n+        opinion = String.new\n+        opinion << dates[i] << ':' << ' ' << comments[i]\n+        opinions.add(opinion)\n+      end\n+      opinions.empty? ? name_to_opinions[name] = ['Не найдено отзывов'] : name_to_opinions[name] = opinions \n+=======\n+      opinions_hash(dates, comments, name)\n+    end\n+    @name_to_opinions\n+  end\n+\n+  def opinions_hash(dates, comments, name)\n+    opinions = Set.new\n+    0.upto(dates.length - 1) do |i|\n+      opinion = String.new(\"\" << dates[i] << ':' << ' ' << comments[i])\n+      opinions.add(opinion)\n+>>>>>>> f1c6eda... homework 3","path":"2015/AlexeyGalenko/bsuir-reviews/opinion.rb","position":59,"original_position":59,"commit_id":"f2362bdfcba5e7a679e8cb85fb73d546335e84c6","original_commit_id":"f2362bdfcba5e7a679e8cb85fb73d546335e84c6","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"unexpected token tRSHFT<br>unexpected token tINTEGER","created_at":"2015-11-03T15:17:33Z","updated_at":"2015-11-03T15:17:33Z","html_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/364#discussion_r43759499","pull_request_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/364","_links":{"self":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments/43759499"},"html":{"href":"https://github.com/rubyroidlabs/bsuir-courses/pull/364#discussion_r43759499"},"pull_request":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/364"}}},"pull_request":{"url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/364","id":49478237,"html_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/364","diff_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/364.diff","patch_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/364.patch","issue_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/364","number":364,"state":"open","locked":false,"title":"hw 3","user":{"login":"vazov","id":8758845,"avatar_url":"https://avatars.githubusercontent.com/u/8758845?v=3","gravatar_id":"","url":"https://api.github.com/users/vazov","html_url":"https://github.com/vazov","followers_url":"https://api.github.com/users/vazov/followers","following_url":"https://api.github.com/users/vazov/following{/other_user}","gists_url":"https://api.github.com/users/vazov/gists{/gist_id}","starred_url":"https://api.github.com/users/vazov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vazov/subscriptions","organizations_url":"https://api.github.com/users/vazov/orgs","repos_url":"https://api.github.com/users/vazov/repos","events_url":"https://api.github.com/users/vazov/events{/privacy}","received_events_url":"https://api.github.com/users/vazov/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-02T20:02:10Z","updated_at":"2015-11-03T15:17:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"73d27b0d3add968d861326885959be59b05df580","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/364/commits","review_comments_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/364/comments","review_comment_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/364/comments","statuses_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/statuses/f2362bdfcba5e7a679e8cb85fb73d546335e84c6","head":{"label":"vazov:master","ref":"master","sha":"f2362bdfcba5e7a679e8cb85fb73d546335e84c6","user":{"login":"vazov","id":8758845,"avatar_url":"https://avatars.githubusercontent.com/u/8758845?v=3","gravatar_id":"","url":"https://api.github.com/users/vazov","html_url":"https://github.com/vazov","followers_url":"https://api.github.com/users/vazov/followers","following_url":"https://api.github.com/users/vazov/following{/other_user}","gists_url":"https://api.github.com/users/vazov/gists{/gist_id}","starred_url":"https://api.github.com/users/vazov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vazov/subscriptions","organizations_url":"https://api.github.com/users/vazov/orgs","repos_url":"https://api.github.com/users/vazov/repos","events_url":"https://api.github.com/users/vazov/events{/privacy}","received_events_url":"https://api.github.com/users/vazov/received_events","type":"User","site_admin":false},"repo":{"id":44051834,"name":"bsuir-courses","full_name":"vazov/bsuir-courses","owner":{"login":"vazov","id":8758845,"avatar_url":"https://avatars.githubusercontent.com/u/8758845?v=3","gravatar_id":"","url":"https://api.github.com/users/vazov","html_url":"https://github.com/vazov","followers_url":"https://api.github.com/users/vazov/followers","following_url":"https://api.github.com/users/vazov/following{/other_user}","gists_url":"https://api.github.com/users/vazov/gists{/gist_id}","starred_url":"https://api.github.com/users/vazov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vazov/subscriptions","organizations_url":"https://api.github.com/users/vazov/orgs","repos_url":"https://api.github.com/users/vazov/repos","events_url":"https://api.github.com/users/vazov/events{/privacy}","received_events_url":"https://api.github.com/users/vazov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vazov/bsuir-courses","description":"This is common repository for all student to submit all their homeworks","fork":true,"url":"https://api.github.com/repos/vazov/bsuir-courses","forks_url":"https://api.github.com/repos/vazov/bsuir-courses/forks","keys_url":"https://api.github.com/repos/vazov/bsuir-courses/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vazov/bsuir-courses/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vazov/bsuir-courses/teams","hooks_url":"https://api.github.com/repos/vazov/bsuir-courses/hooks","issue_events_url":"https://api.github.com/repos/vazov/bsuir-courses/issues/events{/number}","events_url":"https://api.github.com/repos/vazov/bsuir-courses/events","assignees_url":"https://api.github.com/repos/vazov/bsuir-courses/assignees{/user}","branches_url":"https://api.github.com/repos/vazov/bsuir-courses/branches{/branch}","tags_url":"https://api.github.com/repos/vazov/bsuir-courses/tags","blobs_url":"https://api.github.com/repos/vazov/bsuir-courses/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vazov/bsuir-courses/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vazov/bsuir-courses/git/refs{/sha}","trees_url":"https://api.github.com/repos/vazov/bsuir-courses/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vazov/bsuir-courses/statuses/{sha}","languages_url":"https://api.github.com/repos/vazov/bsuir-courses/languages","stargazers_url":"https://api.github.com/repos/vazov/bsuir-courses/stargazers","contributors_url":"https://api.github.com/repos/vazov/bsuir-courses/contributors","subscribers_url":"https://api.github.com/repos/vazov/bsuir-courses/subscribers","subscription_url":"https://api.github.com/repos/vazov/bsuir-courses/subscription","commits_url":"https://api.github.com/repos/vazov/bsuir-courses/commits{/sha}","git_commits_url":"https://api.github.com/repos/vazov/bsuir-courses/git/commits{/sha}","comments_url":"https://api.github.com/repos/vazov/bsuir-courses/comments{/number}","issue_comment_url":"https://api.github.com/repos/vazov/bsuir-courses/issues/comments{/number}","contents_url":"https://api.github.com/repos/vazov/bsuir-courses/contents/{+path}","compare_url":"https://api.github.com/repos/vazov/bsuir-courses/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vazov/bsuir-courses/merges","archive_url":"https://api.github.com/repos/vazov/bsuir-courses/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vazov/bsuir-courses/downloads","issues_url":"https://api.github.com/repos/vazov/bsuir-courses/issues{/number}","pulls_url":"https://api.github.com/repos/vazov/bsuir-courses/pulls{/number}","milestones_url":"https://api.github.com/repos/vazov/bsuir-courses/milestones{/number}","notifications_url":"https://api.github.com/repos/vazov/bsuir-courses/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vazov/bsuir-courses/labels{/name}","releases_url":"https://api.github.com/repos/vazov/bsuir-courses/releases{/id}","created_at":"2015-10-11T12:48:43Z","updated_at":"2015-10-11T12:48:44Z","pushed_at":"2015-11-03T15:17:26Z","git_url":"git://github.com/vazov/bsuir-courses.git","ssh_url":"git@github.com:vazov/bsuir-courses.git","clone_url":"https://github.com/vazov/bsuir-courses.git","svn_url":"https://github.com/vazov/bsuir-courses","homepage":null,"size":527,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rubyroidlabs:master","ref":"master","sha":"1051f68e470ac1f0dff8b4782e48ebba10d5e7bc","user":{"login":"rubyroidlabs","id":5137565,"avatar_url":"https://avatars.githubusercontent.com/u/5137565?v=3","gravatar_id":"","url":"https://api.github.com/users/rubyroidlabs","html_url":"https://github.com/rubyroidlabs","followers_url":"https://api.github.com/users/rubyroidlabs/followers","following_url":"https://api.github.com/users/rubyroidlabs/following{/other_user}","gists_url":"https://api.github.com/users/rubyroidlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rubyroidlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubyroidlabs/subscriptions","organizations_url":"https://api.github.com/users/rubyroidlabs/orgs","repos_url":"https://api.github.com/users/rubyroidlabs/repos","events_url":"https://api.github.com/users/rubyroidlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rubyroidlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":14405320,"name":"bsuir-courses","full_name":"rubyroidlabs/bsuir-courses","owner":{"login":"rubyroidlabs","id":5137565,"avatar_url":"https://avatars.githubusercontent.com/u/5137565?v=3","gravatar_id":"","url":"https://api.github.com/users/rubyroidlabs","html_url":"https://github.com/rubyroidlabs","followers_url":"https://api.github.com/users/rubyroidlabs/followers","following_url":"https://api.github.com/users/rubyroidlabs/following{/other_user}","gists_url":"https://api.github.com/users/rubyroidlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rubyroidlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubyroidlabs/subscriptions","organizations_url":"https://api.github.com/users/rubyroidlabs/orgs","repos_url":"https://api.github.com/users/rubyroidlabs/repos","events_url":"https://api.github.com/users/rubyroidlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rubyroidlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rubyroidlabs/bsuir-courses","description":"This is common repository for all student to submit all their homeworks","fork":false,"url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses","forks_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/forks","keys_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/teams","hooks_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/hooks","issue_events_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/events{/number}","events_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/events","assignees_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/assignees{/user}","branches_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/branches{/branch}","tags_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/tags","blobs_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/refs{/sha}","trees_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/statuses/{sha}","languages_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/languages","stargazers_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/stargazers","contributors_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/contributors","subscribers_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/subscribers","subscription_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/subscription","commits_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/commits{/sha}","git_commits_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/git/commits{/sha}","comments_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/comments{/number}","issue_comment_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/comments{/number}","contents_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/contents/{+path}","compare_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/merges","archive_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/downloads","issues_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues{/number}","pulls_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls{/number}","milestones_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/milestones{/number}","notifications_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/labels{/name}","releases_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/releases{/id}","created_at":"2013-11-14T19:55:12Z","updated_at":"2015-11-02T21:01:50Z","pushed_at":"2015-11-03T15:17:26Z","git_url":"git://github.com/rubyroidlabs/bsuir-courses.git","ssh_url":"git@github.com:rubyroidlabs/bsuir-courses.git","clone_url":"https://github.com/rubyroidlabs/bsuir-courses.git","svn_url":"https://github.com/rubyroidlabs/bsuir-courses","homepage":null,"size":7018,"stargazers_count":22,"watchers_count":22,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":139,"mirror_url":null,"open_issues_count":28,"forks":139,"open_issues":28,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/364"},"html":{"href":"https://github.com/rubyroidlabs/bsuir-courses/pull/364"},"issue":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/364"},"comments":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/364/comments"},"review_comments":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/364/comments"},"review_comment":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/364/commits"},"statuses":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/statuses/f2362bdfcba5e7a679e8cb85fb73d546335e84c6"}}}}