{"action":"created","comment":{"url":"https://api.github.com/repos/ArmadilloXX/flashcards/pulls/comments/46249269","id":46249269,"diff_hunk":"@@ -0,0 +1,99 @@\n+require \"pusher\"\n+require \"nokogiri\"\n+require \"open-uri\"\n+\n+class CardsBatchImporter\n+  attr_reader :params, :result, :originals, :translations\n+\n+  def initialize(url:,\n+                 original_selector:,\n+                 translated_selector:,\n+                 user_id:,\n+                 block_id:)\n+    @params = {\n+      url: url,\n+      original_selector: original_selector,\n+      translated_selector: translated_selector,\n+      user_id: user_id,\n+      block_id: block_id\n+    }\n+    @result = {\n+      cards_count: 0\n+    }\n+  end\n+\n+  def start\n+    if selectors_valid?\n+      parse\n+    else\n+      finish(\"error\", \"CSS selectors are not valid\")\n+    end\n+  end\n+\n+  def notify\n+    data = prepare_notification_data\n+    Pusher.trigger(\"bg-job-notifier-#{params[:user_id]}\", \"job_finished\", data)","path":"app/services/cards_batch_importer.rb","position":35,"original_position":35,"commit_id":"ce0cb647f217316c1103337da9a9f3cc6808c83e","original_commit_id":"ce0cb647f217316c1103337da9a9f3cc6808c83e","user":{"login":"mkdev-mentor-1","id":11962702,"avatar_url":"https://avatars.githubusercontent.com/u/11962702?v=3","gravatar_id":"","url":"https://api.github.com/users/mkdev-mentor-1","html_url":"https://github.com/mkdev-mentor-1","followers_url":"https://api.github.com/users/mkdev-mentor-1/followers","following_url":"https://api.github.com/users/mkdev-mentor-1/following{/other_user}","gists_url":"https://api.github.com/users/mkdev-mentor-1/gists{/gist_id}","starred_url":"https://api.github.com/users/mkdev-mentor-1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkdev-mentor-1/subscriptions","organizations_url":"https://api.github.com/users/mkdev-mentor-1/orgs","repos_url":"https://api.github.com/users/mkdev-mentor-1/repos","events_url":"https://api.github.com/users/mkdev-mentor-1/events{/privacy}","received_events_url":"https://api.github.com/users/mkdev-mentor-1/received_events","type":"User","site_admin":false},"body":"Не нужно ли по окружениям ещё разделить? Или пушер сам это делает?","created_at":"2015-12-01T08:06:55Z","updated_at":"2015-12-01T08:06:55Z","html_url":"https://github.com/ArmadilloXX/flashcards/pull/10#discussion_r46249269","pull_request_url":"https://api.github.com/repos/ArmadilloXX/flashcards/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/ArmadilloXX/flashcards/pulls/comments/46249269"},"html":{"href":"https://github.com/ArmadilloXX/flashcards/pull/10#discussion_r46249269"},"pull_request":{"href":"https://api.github.com/repos/ArmadilloXX/flashcards/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/ArmadilloXX/flashcards/pulls/10","id":51789425,"html_url":"https://github.com/ArmadilloXX/flashcards/pull/10","diff_url":"https://github.com/ArmadilloXX/flashcards/pull/10.diff","patch_url":"https://github.com/ArmadilloXX/flashcards/pull/10.patch","issue_url":"https://api.github.com/repos/ArmadilloXX/flashcards/issues/10","number":10,"state":"open","locked":false,"title":"Seventh task","user":{"login":"ArmadilloXX","id":6916657,"avatar_url":"https://avatars.githubusercontent.com/u/6916657?v=3","gravatar_id":"","url":"https://api.github.com/users/ArmadilloXX","html_url":"https://github.com/ArmadilloXX","followers_url":"https://api.github.com/users/ArmadilloXX/followers","following_url":"https://api.github.com/users/ArmadilloXX/following{/other_user}","gists_url":"https://api.github.com/users/ArmadilloXX/gists{/gist_id}","starred_url":"https://api.github.com/users/ArmadilloXX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArmadilloXX/subscriptions","organizations_url":"https://api.github.com/users/ArmadilloXX/orgs","repos_url":"https://api.github.com/users/ArmadilloXX/repos","events_url":"https://api.github.com/users/ArmadilloXX/events{/privacy}","received_events_url":"https://api.github.com/users/ArmadilloXX/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-25T12:42:59Z","updated_at":"2015-12-01T08:06:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae3c323669bdb801092fa0b82fa0a38716cbc169","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ArmadilloXX/flashcards/pulls/10/commits","review_comments_url":"https://api.github.com/repos/ArmadilloXX/flashcards/pulls/10/comments","review_comment_url":"https://api.github.com/repos/ArmadilloXX/flashcards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ArmadilloXX/flashcards/issues/10/comments","statuses_url":"https://api.github.com/repos/ArmadilloXX/flashcards/statuses/ce0cb647f217316c1103337da9a9f3cc6808c83e","head":{"label":"ArmadilloXX:seventh_task","ref":"seventh_task","sha":"ce0cb647f217316c1103337da9a9f3cc6808c83e","user":{"login":"ArmadilloXX","id":6916657,"avatar_url":"https://avatars.githubusercontent.com/u/6916657?v=3","gravatar_id":"","url":"https://api.github.com/users/ArmadilloXX","html_url":"https://github.com/ArmadilloXX","followers_url":"https://api.github.com/users/ArmadilloXX/followers","following_url":"https://api.github.com/users/ArmadilloXX/following{/other_user}","gists_url":"https://api.github.com/users/ArmadilloXX/gists{/gist_id}","starred_url":"https://api.github.com/users/ArmadilloXX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArmadilloXX/subscriptions","organizations_url":"https://api.github.com/users/ArmadilloXX/orgs","repos_url":"https://api.github.com/users/ArmadilloXX/repos","events_url":"https://api.github.com/users/ArmadilloXX/events{/privacy}","received_events_url":"https://api.github.com/users/ArmadilloXX/received_events","type":"User","site_admin":false},"repo":{"id":42848111,"name":"flashcards","full_name":"ArmadilloXX/flashcards","owner":{"login":"ArmadilloXX","id":6916657,"avatar_url":"https://avatars.githubusercontent.com/u/6916657?v=3","gravatar_id":"","url":"https://api.github.com/users/ArmadilloXX","html_url":"https://github.com/ArmadilloXX","followers_url":"https://api.github.com/users/ArmadilloXX/followers","following_url":"https://api.github.com/users/ArmadilloXX/following{/other_user}","gists_url":"https://api.github.com/users/ArmadilloXX/gists{/gist_id}","starred_url":"https://api.github.com/users/ArmadilloXX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArmadilloXX/subscriptions","organizations_url":"https://api.github.com/users/ArmadilloXX/orgs","repos_url":"https://api.github.com/users/ArmadilloXX/repos","events_url":"https://api.github.com/users/ArmadilloXX/events{/privacy}","received_events_url":"https://api.github.com/users/ArmadilloXX/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ArmadilloXX/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/ArmadilloXX/flashcards","forks_url":"https://api.github.com/repos/ArmadilloXX/flashcards/forks","keys_url":"https://api.github.com/repos/ArmadilloXX/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ArmadilloXX/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ArmadilloXX/flashcards/teams","hooks_url":"https://api.github.com/repos/ArmadilloXX/flashcards/hooks","issue_events_url":"https://api.github.com/repos/ArmadilloXX/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/ArmadilloXX/flashcards/events","assignees_url":"https://api.github.com/repos/ArmadilloXX/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/ArmadilloXX/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/ArmadilloXX/flashcards/tags","blobs_url":"https://api.github.com/repos/ArmadilloXX/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ArmadilloXX/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ArmadilloXX/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/ArmadilloXX/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ArmadilloXX/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/ArmadilloXX/flashcards/languages","stargazers_url":"https://api.github.com/repos/ArmadilloXX/flashcards/stargazers","contributors_url":"https://api.github.com/repos/ArmadilloXX/flashcards/contributors","subscribers_url":"https://api.github.com/repos/ArmadilloXX/flashcards/subscribers","subscription_url":"https://api.github.com/repos/ArmadilloXX/flashcards/subscription","commits_url":"https://api.github.com/repos/ArmadilloXX/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/ArmadilloXX/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/ArmadilloXX/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/ArmadilloXX/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/ArmadilloXX/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/ArmadilloXX/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ArmadilloXX/flashcards/merges","archive_url":"https://api.github.com/repos/ArmadilloXX/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ArmadilloXX/flashcards/downloads","issues_url":"https://api.github.com/repos/ArmadilloXX/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/ArmadilloXX/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/ArmadilloXX/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/ArmadilloXX/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ArmadilloXX/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/ArmadilloXX/flashcards/releases{/id}","created_at":"2015-09-21T06:32:52Z","updated_at":"2015-09-21T06:34:53Z","pushed_at":"2015-11-30T13:44:08Z","git_url":"git://github.com/ArmadilloXX/flashcards.git","ssh_url":"git@github.com:ArmadilloXX/flashcards.git","clone_url":"https://github.com/ArmadilloXX/flashcards.git","svn_url":"https://github.com/ArmadilloXX/flashcards","homepage":null,"size":1306,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"ArmadilloXX:master","ref":"master","sha":"e6fc8f992f93a96af42df04e4c02397980c16274","user":{"login":"ArmadilloXX","id":6916657,"avatar_url":"https://avatars.githubusercontent.com/u/6916657?v=3","gravatar_id":"","url":"https://api.github.com/users/ArmadilloXX","html_url":"https://github.com/ArmadilloXX","followers_url":"https://api.github.com/users/ArmadilloXX/followers","following_url":"https://api.github.com/users/ArmadilloXX/following{/other_user}","gists_url":"https://api.github.com/users/ArmadilloXX/gists{/gist_id}","starred_url":"https://api.github.com/users/ArmadilloXX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArmadilloXX/subscriptions","organizations_url":"https://api.github.com/users/ArmadilloXX/orgs","repos_url":"https://api.github.com/users/ArmadilloXX/repos","events_url":"https://api.github.com/users/ArmadilloXX/events{/privacy}","received_events_url":"https://api.github.com/users/ArmadilloXX/received_events","type":"User","site_admin":false},"repo":{"id":42848111,"name":"flashcards","full_name":"ArmadilloXX/flashcards","owner":{"login":"ArmadilloXX","id":6916657,"avatar_url":"https://avatars.githubusercontent.com/u/6916657?v=3","gravatar_id":"","url":"https://api.github.com/users/ArmadilloXX","html_url":"https://github.com/ArmadilloXX","followers_url":"https://api.github.com/users/ArmadilloXX/followers","following_url":"https://api.github.com/users/ArmadilloXX/following{/other_user}","gists_url":"https://api.github.com/users/ArmadilloXX/gists{/gist_id}","starred_url":"https://api.github.com/users/ArmadilloXX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArmadilloXX/subscriptions","organizations_url":"https://api.github.com/users/ArmadilloXX/orgs","repos_url":"https://api.github.com/users/ArmadilloXX/repos","events_url":"https://api.github.com/users/ArmadilloXX/events{/privacy}","received_events_url":"https://api.github.com/users/ArmadilloXX/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ArmadilloXX/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/ArmadilloXX/flashcards","forks_url":"https://api.github.com/repos/ArmadilloXX/flashcards/forks","keys_url":"https://api.github.com/repos/ArmadilloXX/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ArmadilloXX/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ArmadilloXX/flashcards/teams","hooks_url":"https://api.github.com/repos/ArmadilloXX/flashcards/hooks","issue_events_url":"https://api.github.com/repos/ArmadilloXX/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/ArmadilloXX/flashcards/events","assignees_url":"https://api.github.com/repos/ArmadilloXX/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/ArmadilloXX/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/ArmadilloXX/flashcards/tags","blobs_url":"https://api.github.com/repos/ArmadilloXX/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ArmadilloXX/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ArmadilloXX/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/ArmadilloXX/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ArmadilloXX/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/ArmadilloXX/flashcards/languages","stargazers_url":"https://api.github.com/repos/ArmadilloXX/flashcards/stargazers","contributors_url":"https://api.github.com/repos/ArmadilloXX/flashcards/contributors","subscribers_url":"https://api.github.com/repos/ArmadilloXX/flashcards/subscribers","subscription_url":"https://api.github.com/repos/ArmadilloXX/flashcards/subscription","commits_url":"https://api.github.com/repos/ArmadilloXX/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/ArmadilloXX/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/ArmadilloXX/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/ArmadilloXX/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/ArmadilloXX/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/ArmadilloXX/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ArmadilloXX/flashcards/merges","archive_url":"https://api.github.com/repos/ArmadilloXX/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ArmadilloXX/flashcards/downloads","issues_url":"https://api.github.com/repos/ArmadilloXX/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/ArmadilloXX/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/ArmadilloXX/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/ArmadilloXX/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ArmadilloXX/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/ArmadilloXX/flashcards/releases{/id}","created_at":"2015-09-21T06:32:52Z","updated_at":"2015-09-21T06:34:53Z","pushed_at":"2015-11-30T13:44:08Z","git_url":"git://github.com/ArmadilloXX/flashcards.git","ssh_url":"git@github.com:ArmadilloXX/flashcards.git","clone_url":"https://github.com/ArmadilloXX/flashcards.git","svn_url":"https://github.com/ArmadilloXX/flashcards","homepage":null,"size":1306,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ArmadilloXX/flashcards/pulls/10"},"html":{"href":"https://github.com/ArmadilloXX/flashcards/pull/10"},"issue":{"href":"https://api.github.com/repos/ArmadilloXX/flashcards/issues/10"},"comments":{"href":"https://api.github.com/repos/ArmadilloXX/flashcards/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/ArmadilloXX/flashcards/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/ArmadilloXX/flashcards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ArmadilloXX/flashcards/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/ArmadilloXX/flashcards/statuses/ce0cb647f217316c1103337da9a9f3cc6808c83e"}}}}