{"action":"created","comment":{"url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments/43724446","id":43724446,"diff_hunk":"@@ -0,0 +1,69 @@\n+#coding: utf-8\n+require 'yaml'\n+require 'colorize'\n+\n+class Group\n+  attr_accessor :num_of_group, :opinions_about_lectors, :lectors, :schedule_page, :lectors_of_group_from_helper\n+  attr_reader :config, :schedule_link\n+  def initialize number\n+    @num_of_group = number;\n+    @schedule_link = \"http://www.bsuir.by/schedule/schedule.xhtml?id=#{@num_of_group}\"\n+    @lectors_of_group_from_helper = {}\n+    @opinions_about_lectors = {}\n+    @config = YAML::load(open('../task_3/lib/opinions.yml'))\n+  end\n+\n+  def get_all_lectors\n+    @lectors = @schedule_page.css('tr.ui-widget-content').map {|el| el.children[5].children.text}.uniq.select {|str| str.present?}\n+  end\n+\n+  def get_lectors_from_helper all_lectors\n+    @lectors.each do |lector|\n+      all_lectors.each do |key, value|\n+        if (key == lector)\n+          @lectors_of_group_from_helper[key] = value\n+        end\n+      end\n+    end\n+  end \n+\n+  def get_opinions \n+    downloader = Downloader.new\n+    @lectors_of_group_from_helper.each do |key, value|\n+      page = downloader.get_page_nokogiri(\"http://bsuir-helper.ru/#{value.href}\")     \n+      comments = {}\n+      text = page.css('div.rounded-outside div.comment p').map {|el| el.children.text}\n+      date = page.css('div.rounded-outside div.comment div.submitted span.comment-date').map {|el| el.children.text}\n+      date.zip(text) { |a, b| comments[a.to_sym] = b}\n+      @opinions_about_lectors[key] = comments\n+    end\n+  end \n+\n+  def print_opinions\n+    @lectors.each do |lector|\n+      if !(@opinions_about_lectors.keys.include?(lector))\n+        @opinions_about_lectors[lector] = []\n+      end\n+    end\n+    @opinions_about_lectors.each do |key, value|\n+      puts key \n+      puts \"Не найдено отзывов\" if value.empty?\n+      value.each do |date, text|\n+\n+        puts \"#{date} -- #{text.colorize(check_opinion(text))}\"        ","path":"2015/DenisSimonchik/task_3/lib/group.rb","position":53,"original_position":53,"commit_id":"38e07fa11f10e4598097a177478bd8484ceb481b","original_commit_id":"38e07fa11f10e4598097a177478bd8484ceb481b","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":"Trailing whitespace detected.","created_at":"2015-11-03T08:32:08Z","updated_at":"2015-11-03T08:32:08Z","html_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/374#discussion_r43724446","pull_request_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/374","_links":{"self":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/comments/43724446"},"html":{"href":"https://github.com/rubyroidlabs/bsuir-courses/pull/374#discussion_r43724446"},"pull_request":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/374"}}},"pull_request":{"url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/374","id":49529356,"html_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/374","diff_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/374.diff","patch_url":"https://github.com/rubyroidlabs/bsuir-courses/pull/374.patch","issue_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/374","number":374,"state":"open","locked":false,"title":"task_3","user":{"login":"ddzyanis","id":3635711,"avatar_url":"https://avatars.githubusercontent.com/u/3635711?v=3","gravatar_id":"","url":"https://api.github.com/users/ddzyanis","html_url":"https://github.com/ddzyanis","followers_url":"https://api.github.com/users/ddzyanis/followers","following_url":"https://api.github.com/users/ddzyanis/following{/other_user}","gists_url":"https://api.github.com/users/ddzyanis/gists{/gist_id}","starred_url":"https://api.github.com/users/ddzyanis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddzyanis/subscriptions","organizations_url":"https://api.github.com/users/ddzyanis/orgs","repos_url":"https://api.github.com/users/ddzyanis/repos","events_url":"https://api.github.com/users/ddzyanis/events{/privacy}","received_events_url":"https://api.github.com/users/ddzyanis/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-03T08:32:01Z","updated_at":"2015-11-03T08:32:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de3f8732c75b9a6440b04aeb2caea3d72ac8b427","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/374/commits","review_comments_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/374/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/374/comments","statuses_url":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/statuses/38e07fa11f10e4598097a177478bd8484ceb481b","head":{"label":"ddzyanis:master","ref":"master","sha":"38e07fa11f10e4598097a177478bd8484ceb481b","user":{"login":"ddzyanis","id":3635711,"avatar_url":"https://avatars.githubusercontent.com/u/3635711?v=3","gravatar_id":"","url":"https://api.github.com/users/ddzyanis","html_url":"https://github.com/ddzyanis","followers_url":"https://api.github.com/users/ddzyanis/followers","following_url":"https://api.github.com/users/ddzyanis/following{/other_user}","gists_url":"https://api.github.com/users/ddzyanis/gists{/gist_id}","starred_url":"https://api.github.com/users/ddzyanis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddzyanis/subscriptions","organizations_url":"https://api.github.com/users/ddzyanis/orgs","repos_url":"https://api.github.com/users/ddzyanis/repos","events_url":"https://api.github.com/users/ddzyanis/events{/privacy}","received_events_url":"https://api.github.com/users/ddzyanis/received_events","type":"User","site_admin":false},"repo":{"id":25222162,"name":"bsuir-courses","full_name":"ddzyanis/bsuir-courses","owner":{"login":"ddzyanis","id":3635711,"avatar_url":"https://avatars.githubusercontent.com/u/3635711?v=3","gravatar_id":"","url":"https://api.github.com/users/ddzyanis","html_url":"https://github.com/ddzyanis","followers_url":"https://api.github.com/users/ddzyanis/followers","following_url":"https://api.github.com/users/ddzyanis/following{/other_user}","gists_url":"https://api.github.com/users/ddzyanis/gists{/gist_id}","starred_url":"https://api.github.com/users/ddzyanis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddzyanis/subscriptions","organizations_url":"https://api.github.com/users/ddzyanis/orgs","repos_url":"https://api.github.com/users/ddzyanis/repos","events_url":"https://api.github.com/users/ddzyanis/events{/privacy}","received_events_url":"https://api.github.com/users/ddzyanis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ddzyanis/bsuir-courses","description":"This is common repository for all student to submit all their homeworks","fork":true,"url":"https://api.github.com/repos/ddzyanis/bsuir-courses","forks_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/forks","keys_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/teams","hooks_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/hooks","issue_events_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/issues/events{/number}","events_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/events","assignees_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/assignees{/user}","branches_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/branches{/branch}","tags_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/tags","blobs_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/git/refs{/sha}","trees_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/statuses/{sha}","languages_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/languages","stargazers_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/stargazers","contributors_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/contributors","subscribers_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/subscribers","subscription_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/subscription","commits_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/commits{/sha}","git_commits_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/git/commits{/sha}","comments_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/comments{/number}","issue_comment_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/issues/comments{/number}","contents_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/contents/{+path}","compare_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/merges","archive_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/downloads","issues_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/issues{/number}","pulls_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/pulls{/number}","milestones_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/milestones{/number}","notifications_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/labels{/name}","releases_url":"https://api.github.com/repos/ddzyanis/bsuir-courses/releases{/id}","created_at":"2014-10-14T19:08:27Z","updated_at":"2015-10-14T07:51:08Z","pushed_at":"2015-11-03T08:27:25Z","git_url":"git://github.com/ddzyanis/bsuir-courses.git","ssh_url":"git@github.com:ddzyanis/bsuir-courses.git","clone_url":"https://github.com/ddzyanis/bsuir-courses.git","svn_url":"https://github.com/ddzyanis/bsuir-courses","homepage":null,"size":194,"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-03T08:32:01Z","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":6541,"stargazers_count":22,"watchers_count":22,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":138,"mirror_url":null,"open_issues_count":27,"forks":138,"open_issues":27,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/374"},"html":{"href":"https://github.com/rubyroidlabs/bsuir-courses/pull/374"},"issue":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/374"},"comments":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/issues/374/comments"},"review_comments":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/pulls/374/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/374/commits"},"statuses":{"href":"https://api.github.com/repos/rubyroidlabs/bsuir-courses/statuses/38e07fa11f10e4598097a177478bd8484ceb481b"}}}}