{"action":"created","comment":{"url":"https://api.github.com/repos/wagn/wikirate/pulls/comments/59912199","id":59912199,"diff_hunk":"@@ -0,0 +1,40 @@\n+require File.expand_path('../../../config/environment',  __FILE__)\n+require 'colorize'\n+require 'json'\n+require 'byebug'\n+require 'rubygems'\n+require 'csv'\n+\n+file_name = 'script/metric/data/sources.csv'\n+\n+def create_company company\n+  return if Card.exists? company\n+  Card.create! name: company, type_id: Card::WikirateCompanyID\n+end\n+\n+Card::Env[:protocol] = 'http://'\n+Card::Env[:host] = 'http://wikirate.org'\n+Card::Auth.current_id = Card.fetch_id 'Richard Mills'\n+\n+Card::Auth.as_bot do\n+  Card::Env.params[:sourcebox] = 'true'\n+  CSV.foreach(file_name, encoding: 'windows-1251:utf-8',\n+                         headers: false) do |row|\n+    url = row[0]\n+    company = row[1]\n+    year = row[2]\n+    report_type = row[3]\n+\n+    create_company company\n+\n+    arg = { type_id: Card::SourceID,\n+            subcards: {\n+              '+Link' => { content: url },\n+              '+report_type' => report_type,\n+              '+date' => year\n+            } }\n+    puts arg.to_s.green\n+    Card.create! arg\n+  end\n+  Card::Env.params[:sourcebox] = 'false'","path":"script/metric/import_sources.rb","position":39,"original_position":39,"commit_id":"84155b03a992e0c3a3619f49fa0225e259a84427","original_commit_id":"84155b03a992e0c3a3619f49fa0225e259a84427","user":{"login":"ethn","id":21904,"avatar_url":"https://avatars.githubusercontent.com/u/21904?v=3","gravatar_id":"","url":"https://api.github.com/users/ethn","html_url":"https://github.com/ethn","followers_url":"https://api.github.com/users/ethn/followers","following_url":"https://api.github.com/users/ethn/following{/other_user}","gists_url":"https://api.github.com/users/ethn/gists{/gist_id}","starred_url":"https://api.github.com/users/ethn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethn/subscriptions","organizations_url":"https://api.github.com/users/ethn/orgs","repos_url":"https://api.github.com/users/ethn/repos","events_url":"https://api.github.com/users/ethn/events{/privacy}","received_events_url":"https://api.github.com/users/ethn/received_events","type":"User","site_admin":false},"body":"does that really do anything?","created_at":"2016-04-15T17:43:26Z","updated_at":"2016-04-15T17:43:26Z","html_url":"https://github.com/wagn/wikirate/pull/381#discussion_r59912199","pull_request_url":"https://api.github.com/repos/wagn/wikirate/pulls/381","_links":{"self":{"href":"https://api.github.com/repos/wagn/wikirate/pulls/comments/59912199"},"html":{"href":"https://github.com/wagn/wikirate/pull/381#discussion_r59912199"},"pull_request":{"href":"https://api.github.com/repos/wagn/wikirate/pulls/381"}}},"pull_request":{"url":"https://api.github.com/repos/wagn/wikirate/pulls/381","id":66674370,"html_url":"https://github.com/wagn/wikirate/pull/381","diff_url":"https://github.com/wagn/wikirate/pull/381.diff","patch_url":"https://github.com/wagn/wikirate/pull/381.patch","issue_url":"https://api.github.com/repos/wagn/wikirate/issues/381","number":381,"state":"open","locked":false,"title":"Metrics","user":{"login":"srivig","id":6579236,"avatar_url":"https://avatars.githubusercontent.com/u/6579236?v=3","gravatar_id":"","url":"https://api.github.com/users/srivig","html_url":"https://github.com/srivig","followers_url":"https://api.github.com/users/srivig/followers","following_url":"https://api.github.com/users/srivig/following{/other_user}","gists_url":"https://api.github.com/users/srivig/gists{/gist_id}","starred_url":"https://api.github.com/users/srivig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srivig/subscriptions","organizations_url":"https://api.github.com/users/srivig/orgs","repos_url":"https://api.github.com/users/srivig/repos","events_url":"https://api.github.com/users/srivig/events{/privacy}","received_events_url":"https://api.github.com/users/srivig/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-15T17:07:35Z","updated_at":"2016-04-15T17:43:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88db038c9395f59ccfbf8d66abb4b814acc02fcd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wagn/wikirate/pulls/381/commits","review_comments_url":"https://api.github.com/repos/wagn/wikirate/pulls/381/comments","review_comment_url":"https://api.github.com/repos/wagn/wikirate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wagn/wikirate/issues/381/comments","statuses_url":"https://api.github.com/repos/wagn/wikirate/statuses/84155b03a992e0c3a3619f49fa0225e259a84427","head":{"label":"srivig:metrics","ref":"metrics","sha":"84155b03a992e0c3a3619f49fa0225e259a84427","user":{"login":"srivig","id":6579236,"avatar_url":"https://avatars.githubusercontent.com/u/6579236?v=3","gravatar_id":"","url":"https://api.github.com/users/srivig","html_url":"https://github.com/srivig","followers_url":"https://api.github.com/users/srivig/followers","following_url":"https://api.github.com/users/srivig/following{/other_user}","gists_url":"https://api.github.com/users/srivig/gists{/gist_id}","starred_url":"https://api.github.com/users/srivig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srivig/subscriptions","organizations_url":"https://api.github.com/users/srivig/orgs","repos_url":"https://api.github.com/users/srivig/repos","events_url":"https://api.github.com/users/srivig/events{/privacy}","received_events_url":"https://api.github.com/users/srivig/received_events","type":"User","site_admin":false},"repo":{"id":26482921,"name":"wikirate","full_name":"srivig/wikirate","owner":{"login":"srivig","id":6579236,"avatar_url":"https://avatars.githubusercontent.com/u/6579236?v=3","gravatar_id":"","url":"https://api.github.com/users/srivig","html_url":"https://github.com/srivig","followers_url":"https://api.github.com/users/srivig/followers","following_url":"https://api.github.com/users/srivig/following{/other_user}","gists_url":"https://api.github.com/users/srivig/gists{/gist_id}","starred_url":"https://api.github.com/users/srivig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srivig/subscriptions","organizations_url":"https://api.github.com/users/srivig/orgs","repos_url":"https://api.github.com/users/srivig/repos","events_url":"https://api.github.com/users/srivig/events{/privacy}","received_events_url":"https://api.github.com/users/srivig/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/srivig/wikirate","description":"","fork":true,"url":"https://api.github.com/repos/srivig/wikirate","forks_url":"https://api.github.com/repos/srivig/wikirate/forks","keys_url":"https://api.github.com/repos/srivig/wikirate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/srivig/wikirate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/srivig/wikirate/teams","hooks_url":"https://api.github.com/repos/srivig/wikirate/hooks","issue_events_url":"https://api.github.com/repos/srivig/wikirate/issues/events{/number}","events_url":"https://api.github.com/repos/srivig/wikirate/events","assignees_url":"https://api.github.com/repos/srivig/wikirate/assignees{/user}","branches_url":"https://api.github.com/repos/srivig/wikirate/branches{/branch}","tags_url":"https://api.github.com/repos/srivig/wikirate/tags","blobs_url":"https://api.github.com/repos/srivig/wikirate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/srivig/wikirate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/srivig/wikirate/git/refs{/sha}","trees_url":"https://api.github.com/repos/srivig/wikirate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/srivig/wikirate/statuses/{sha}","languages_url":"https://api.github.com/repos/srivig/wikirate/languages","stargazers_url":"https://api.github.com/repos/srivig/wikirate/stargazers","contributors_url":"https://api.github.com/repos/srivig/wikirate/contributors","subscribers_url":"https://api.github.com/repos/srivig/wikirate/subscribers","subscription_url":"https://api.github.com/repos/srivig/wikirate/subscription","commits_url":"https://api.github.com/repos/srivig/wikirate/commits{/sha}","git_commits_url":"https://api.github.com/repos/srivig/wikirate/git/commits{/sha}","comments_url":"https://api.github.com/repos/srivig/wikirate/comments{/number}","issue_comment_url":"https://api.github.com/repos/srivig/wikirate/issues/comments{/number}","contents_url":"https://api.github.com/repos/srivig/wikirate/contents/{+path}","compare_url":"https://api.github.com/repos/srivig/wikirate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/srivig/wikirate/merges","archive_url":"https://api.github.com/repos/srivig/wikirate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/srivig/wikirate/downloads","issues_url":"https://api.github.com/repos/srivig/wikirate/issues{/number}","pulls_url":"https://api.github.com/repos/srivig/wikirate/pulls{/number}","milestones_url":"https://api.github.com/repos/srivig/wikirate/milestones{/number}","notifications_url":"https://api.github.com/repos/srivig/wikirate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/srivig/wikirate/labels{/name}","releases_url":"https://api.github.com/repos/srivig/wikirate/releases{/id}","deployments_url":"https://api.github.com/repos/srivig/wikirate/deployments","created_at":"2014-11-11T11:53:21Z","updated_at":"2015-11-09T14:04:46Z","pushed_at":"2016-04-15T17:04:34Z","git_url":"git://github.com/srivig/wikirate.git","ssh_url":"git@github.com:srivig/wikirate.git","clone_url":"https://github.com/srivig/wikirate.git","svn_url":"https://github.com/srivig/wikirate","homepage":null,"size":86580,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"wagn:master","ref":"master","sha":"53479957db8403e4c27a76e146142cb208fb7120","user":{"login":"wagn","id":20722,"avatar_url":"https://avatars.githubusercontent.com/u/20722?v=3","gravatar_id":"","url":"https://api.github.com/users/wagn","html_url":"https://github.com/wagn","followers_url":"https://api.github.com/users/wagn/followers","following_url":"https://api.github.com/users/wagn/following{/other_user}","gists_url":"https://api.github.com/users/wagn/gists{/gist_id}","starred_url":"https://api.github.com/users/wagn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wagn/subscriptions","organizations_url":"https://api.github.com/users/wagn/orgs","repos_url":"https://api.github.com/users/wagn/repos","events_url":"https://api.github.com/users/wagn/events{/privacy}","received_events_url":"https://api.github.com/users/wagn/received_events","type":"User","site_admin":false},"repo":{"id":15884166,"name":"wikirate","full_name":"wagn/wikirate","owner":{"login":"wagn","id":20722,"avatar_url":"https://avatars.githubusercontent.com/u/20722?v=3","gravatar_id":"","url":"https://api.github.com/users/wagn","html_url":"https://github.com/wagn","followers_url":"https://api.github.com/users/wagn/followers","following_url":"https://api.github.com/users/wagn/following{/other_user}","gists_url":"https://api.github.com/users/wagn/gists{/gist_id}","starred_url":"https://api.github.com/users/wagn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wagn/subscriptions","organizations_url":"https://api.github.com/users/wagn/orgs","repos_url":"https://api.github.com/users/wagn/repos","events_url":"https://api.github.com/users/wagn/events{/privacy}","received_events_url":"https://api.github.com/users/wagn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wagn/wikirate","description":"","fork":false,"url":"https://api.github.com/repos/wagn/wikirate","forks_url":"https://api.github.com/repos/wagn/wikirate/forks","keys_url":"https://api.github.com/repos/wagn/wikirate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wagn/wikirate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wagn/wikirate/teams","hooks_url":"https://api.github.com/repos/wagn/wikirate/hooks","issue_events_url":"https://api.github.com/repos/wagn/wikirate/issues/events{/number}","events_url":"https://api.github.com/repos/wagn/wikirate/events","assignees_url":"https://api.github.com/repos/wagn/wikirate/assignees{/user}","branches_url":"https://api.github.com/repos/wagn/wikirate/branches{/branch}","tags_url":"https://api.github.com/repos/wagn/wikirate/tags","blobs_url":"https://api.github.com/repos/wagn/wikirate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wagn/wikirate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wagn/wikirate/git/refs{/sha}","trees_url":"https://api.github.com/repos/wagn/wikirate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wagn/wikirate/statuses/{sha}","languages_url":"https://api.github.com/repos/wagn/wikirate/languages","stargazers_url":"https://api.github.com/repos/wagn/wikirate/stargazers","contributors_url":"https://api.github.com/repos/wagn/wikirate/contributors","subscribers_url":"https://api.github.com/repos/wagn/wikirate/subscribers","subscription_url":"https://api.github.com/repos/wagn/wikirate/subscription","commits_url":"https://api.github.com/repos/wagn/wikirate/commits{/sha}","git_commits_url":"https://api.github.com/repos/wagn/wikirate/git/commits{/sha}","comments_url":"https://api.github.com/repos/wagn/wikirate/comments{/number}","issue_comment_url":"https://api.github.com/repos/wagn/wikirate/issues/comments{/number}","contents_url":"https://api.github.com/repos/wagn/wikirate/contents/{+path}","compare_url":"https://api.github.com/repos/wagn/wikirate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wagn/wikirate/merges","archive_url":"https://api.github.com/repos/wagn/wikirate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wagn/wikirate/downloads","issues_url":"https://api.github.com/repos/wagn/wikirate/issues{/number}","pulls_url":"https://api.github.com/repos/wagn/wikirate/pulls{/number}","milestones_url":"https://api.github.com/repos/wagn/wikirate/milestones{/number}","notifications_url":"https://api.github.com/repos/wagn/wikirate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wagn/wikirate/labels{/name}","releases_url":"https://api.github.com/repos/wagn/wikirate/releases{/id}","deployments_url":"https://api.github.com/repos/wagn/wikirate/deployments","created_at":"2014-01-13T22:29:39Z","updated_at":"2016-01-11T16:43:51Z","pushed_at":"2016-04-15T17:38:28Z","git_url":"git://github.com/wagn/wikirate.git","ssh_url":"git@github.com:wagn/wikirate.git","clone_url":"https://github.com/wagn/wikirate.git","svn_url":"https://github.com/wagn/wikirate","homepage":null,"size":86608,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wagn/wikirate/pulls/381"},"html":{"href":"https://github.com/wagn/wikirate/pull/381"},"issue":{"href":"https://api.github.com/repos/wagn/wikirate/issues/381"},"comments":{"href":"https://api.github.com/repos/wagn/wikirate/issues/381/comments"},"review_comments":{"href":"https://api.github.com/repos/wagn/wikirate/pulls/381/comments"},"review_comment":{"href":"https://api.github.com/repos/wagn/wikirate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wagn/wikirate/pulls/381/commits"},"statuses":{"href":"https://api.github.com/repos/wagn/wikirate/statuses/84155b03a992e0c3a3619f49fa0225e259a84427"}}}}