{"action":"created","comment":{"url":"https://api.github.com/repos/bem-incubator/stat-counters/pulls/comments/51866842","id":51866842,"diff_hunk":"@@ -0,0 +1,60 @@\n+block('statcounter').def()(function() {\n+    var params = this.ctx.params,\n+        scriptContent,\n+        noScriptContent;\n+\n+    if(!params) {\n+        throw Error('Missing counter parameters object');\n+    }\n+\n+    if(!params.project) {\n+        throw Error('Missing counter project ID');\n+    }\n+\n+    if(!params.security) {\n+        throw Error('Missing counter security ID');\n+    }\n+\n+    scriptContent = [\n+        'var sc_project=' + params.project + ';',\n+        'var sc_invisible=1;',\n+        'var sc_security=\"' + params.security + '\";',\n+        'var scJsHost = ((\"https:\" == document.location.protocol) ?',\n+        '\"https://secure.\" : \"http://www.\");',\n+        'document.write(\"<sc\"+\"ript type=\\'text/javascript\\' src=\\'\" +',\n+        'scJsHost+',\n+        '\"statcounter.com/counter/counter.js\\'></\"+\"script>\");'\n+    ].join('\\n');\n+\n+    noScriptContent = {\n+        tag : 'div',\n+        attrs : { class : 'statcounter' },","path":"common.blocks/statcounter/statcounter.bemhtml","position":31,"original_position":31,"commit_id":"5cc697c540fd3a086d5069f1cb3bd68542c6565c","original_commit_id":"5cc697c540fd3a086d5069f1cb3bd68542c6565c","user":{"login":"levonet","id":3680861,"avatar_url":"https://avatars.githubusercontent.com/u/3680861?v=3","gravatar_id":"","url":"https://api.github.com/users/levonet","html_url":"https://github.com/levonet","followers_url":"https://api.github.com/users/levonet/followers","following_url":"https://api.github.com/users/levonet/following{/other_user}","gists_url":"https://api.github.com/users/levonet/gists{/gist_id}","starred_url":"https://api.github.com/users/levonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/levonet/subscriptions","organizations_url":"https://api.github.com/users/levonet/orgs","repos_url":"https://api.github.com/users/levonet/repos","events_url":"https://api.github.com/users/levonet/events{/privacy}","received_events_url":"https://api.github.com/users/levonet/received_events","type":"User","site_admin":false},"body":"@tadatuta, как можно сделать не так костыльно в данном случае?","created_at":"2016-02-04T12:39:06Z","updated_at":"2016-02-04T12:39:06Z","html_url":"https://github.com/bem-incubator/stat-counters/pull/43#discussion_r51866842","pull_request_url":"https://api.github.com/repos/bem-incubator/stat-counters/pulls/43","_links":{"self":{"href":"https://api.github.com/repos/bem-incubator/stat-counters/pulls/comments/51866842"},"html":{"href":"https://github.com/bem-incubator/stat-counters/pull/43#discussion_r51866842"},"pull_request":{"href":"https://api.github.com/repos/bem-incubator/stat-counters/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/bem-incubator/stat-counters/pulls/43","id":58215867,"html_url":"https://github.com/bem-incubator/stat-counters/pull/43","diff_url":"https://github.com/bem-incubator/stat-counters/pull/43.diff","patch_url":"https://github.com/bem-incubator/stat-counters/pull/43.patch","issue_url":"https://api.github.com/repos/bem-incubator/stat-counters/issues/43","number":43,"state":"open","locked":false,"title":"Added statcounter block","user":{"login":"levonet","id":3680861,"avatar_url":"https://avatars.githubusercontent.com/u/3680861?v=3","gravatar_id":"","url":"https://api.github.com/users/levonet","html_url":"https://github.com/levonet","followers_url":"https://api.github.com/users/levonet/followers","following_url":"https://api.github.com/users/levonet/following{/other_user}","gists_url":"https://api.github.com/users/levonet/gists{/gist_id}","starred_url":"https://api.github.com/users/levonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/levonet/subscriptions","organizations_url":"https://api.github.com/users/levonet/orgs","repos_url":"https://api.github.com/users/levonet/repos","events_url":"https://api.github.com/users/levonet/events{/privacy}","received_events_url":"https://api.github.com/users/levonet/received_events","type":"User","site_admin":false},"body":"\\cc @zxqfox @remnev ","created_at":"2016-02-03T23:03:36Z","updated_at":"2016-02-04T12:39:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd8eaf2d6c54e528e852694fe964ffbfa8d0821e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bem-incubator/stat-counters/pulls/43/commits","review_comments_url":"https://api.github.com/repos/bem-incubator/stat-counters/pulls/43/comments","review_comment_url":"https://api.github.com/repos/bem-incubator/stat-counters/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bem-incubator/stat-counters/issues/43/comments","statuses_url":"https://api.github.com/repos/bem-incubator/stat-counters/statuses/5cc697c540fd3a086d5069f1cb3bd68542c6565c","head":{"label":"bem-incubator:statcounter","ref":"statcounter","sha":"5cc697c540fd3a086d5069f1cb3bd68542c6565c","user":{"login":"bem-incubator","id":10929504,"avatar_url":"https://avatars.githubusercontent.com/u/10929504?v=3","gravatar_id":"","url":"https://api.github.com/users/bem-incubator","html_url":"https://github.com/bem-incubator","followers_url":"https://api.github.com/users/bem-incubator/followers","following_url":"https://api.github.com/users/bem-incubator/following{/other_user}","gists_url":"https://api.github.com/users/bem-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/bem-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bem-incubator/subscriptions","organizations_url":"https://api.github.com/users/bem-incubator/orgs","repos_url":"https://api.github.com/users/bem-incubator/repos","events_url":"https://api.github.com/users/bem-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/bem-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":33719999,"name":"stat-counters","full_name":"bem-incubator/stat-counters","owner":{"login":"bem-incubator","id":10929504,"avatar_url":"https://avatars.githubusercontent.com/u/10929504?v=3","gravatar_id":"","url":"https://api.github.com/users/bem-incubator","html_url":"https://github.com/bem-incubator","followers_url":"https://api.github.com/users/bem-incubator/followers","following_url":"https://api.github.com/users/bem-incubator/following{/other_user}","gists_url":"https://api.github.com/users/bem-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/bem-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bem-incubator/subscriptions","organizations_url":"https://api.github.com/users/bem-incubator/orgs","repos_url":"https://api.github.com/users/bem-incubator/repos","events_url":"https://api.github.com/users/bem-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/bem-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bem-incubator/stat-counters","description":"The library, which provides statistics counters, e.g. Google analytics, Yandex metrica, etc","fork":false,"url":"https://api.github.com/repos/bem-incubator/stat-counters","forks_url":"https://api.github.com/repos/bem-incubator/stat-counters/forks","keys_url":"https://api.github.com/repos/bem-incubator/stat-counters/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bem-incubator/stat-counters/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bem-incubator/stat-counters/teams","hooks_url":"https://api.github.com/repos/bem-incubator/stat-counters/hooks","issue_events_url":"https://api.github.com/repos/bem-incubator/stat-counters/issues/events{/number}","events_url":"https://api.github.com/repos/bem-incubator/stat-counters/events","assignees_url":"https://api.github.com/repos/bem-incubator/stat-counters/assignees{/user}","branches_url":"https://api.github.com/repos/bem-incubator/stat-counters/branches{/branch}","tags_url":"https://api.github.com/repos/bem-incubator/stat-counters/tags","blobs_url":"https://api.github.com/repos/bem-incubator/stat-counters/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bem-incubator/stat-counters/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bem-incubator/stat-counters/git/refs{/sha}","trees_url":"https://api.github.com/repos/bem-incubator/stat-counters/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bem-incubator/stat-counters/statuses/{sha}","languages_url":"https://api.github.com/repos/bem-incubator/stat-counters/languages","stargazers_url":"https://api.github.com/repos/bem-incubator/stat-counters/stargazers","contributors_url":"https://api.github.com/repos/bem-incubator/stat-counters/contributors","subscribers_url":"https://api.github.com/repos/bem-incubator/stat-counters/subscribers","subscription_url":"https://api.github.com/repos/bem-incubator/stat-counters/subscription","commits_url":"https://api.github.com/repos/bem-incubator/stat-counters/commits{/sha}","git_commits_url":"https://api.github.com/repos/bem-incubator/stat-counters/git/commits{/sha}","comments_url":"https://api.github.com/repos/bem-incubator/stat-counters/comments{/number}","issue_comment_url":"https://api.github.com/repos/bem-incubator/stat-counters/issues/comments{/number}","contents_url":"https://api.github.com/repos/bem-incubator/stat-counters/contents/{+path}","compare_url":"https://api.github.com/repos/bem-incubator/stat-counters/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bem-incubator/stat-counters/merges","archive_url":"https://api.github.com/repos/bem-incubator/stat-counters/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bem-incubator/stat-counters/downloads","issues_url":"https://api.github.com/repos/bem-incubator/stat-counters/issues{/number}","pulls_url":"https://api.github.com/repos/bem-incubator/stat-counters/pulls{/number}","milestones_url":"https://api.github.com/repos/bem-incubator/stat-counters/milestones{/number}","notifications_url":"https://api.github.com/repos/bem-incubator/stat-counters/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bem-incubator/stat-counters/labels{/name}","releases_url":"https://api.github.com/repos/bem-incubator/stat-counters/releases{/id}","deployments_url":"https://api.github.com/repos/bem-incubator/stat-counters/deployments","created_at":"2015-04-10T09:21:50Z","updated_at":"2015-07-01T19:02:15Z","pushed_at":"2016-02-03T23:03:37Z","git_url":"git://github.com/bem-incubator/stat-counters.git","ssh_url":"git@github.com:bem-incubator/stat-counters.git","clone_url":"https://github.com/bem-incubator/stat-counters.git","svn_url":"https://github.com/bem-incubator/stat-counters","homepage":"","size":69,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":9,"forks":5,"open_issues":9,"watchers":8,"default_branch":"master"}},"base":{"label":"bem-incubator:master","ref":"master","sha":"1c9406539f49ebf2592b9001f882c3227f31a84f","user":{"login":"bem-incubator","id":10929504,"avatar_url":"https://avatars.githubusercontent.com/u/10929504?v=3","gravatar_id":"","url":"https://api.github.com/users/bem-incubator","html_url":"https://github.com/bem-incubator","followers_url":"https://api.github.com/users/bem-incubator/followers","following_url":"https://api.github.com/users/bem-incubator/following{/other_user}","gists_url":"https://api.github.com/users/bem-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/bem-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bem-incubator/subscriptions","organizations_url":"https://api.github.com/users/bem-incubator/orgs","repos_url":"https://api.github.com/users/bem-incubator/repos","events_url":"https://api.github.com/users/bem-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/bem-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":33719999,"name":"stat-counters","full_name":"bem-incubator/stat-counters","owner":{"login":"bem-incubator","id":10929504,"avatar_url":"https://avatars.githubusercontent.com/u/10929504?v=3","gravatar_id":"","url":"https://api.github.com/users/bem-incubator","html_url":"https://github.com/bem-incubator","followers_url":"https://api.github.com/users/bem-incubator/followers","following_url":"https://api.github.com/users/bem-incubator/following{/other_user}","gists_url":"https://api.github.com/users/bem-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/bem-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bem-incubator/subscriptions","organizations_url":"https://api.github.com/users/bem-incubator/orgs","repos_url":"https://api.github.com/users/bem-incubator/repos","events_url":"https://api.github.com/users/bem-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/bem-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bem-incubator/stat-counters","description":"The library, which provides statistics counters, e.g. Google analytics, Yandex metrica, etc","fork":false,"url":"https://api.github.com/repos/bem-incubator/stat-counters","forks_url":"https://api.github.com/repos/bem-incubator/stat-counters/forks","keys_url":"https://api.github.com/repos/bem-incubator/stat-counters/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bem-incubator/stat-counters/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bem-incubator/stat-counters/teams","hooks_url":"https://api.github.com/repos/bem-incubator/stat-counters/hooks","issue_events_url":"https://api.github.com/repos/bem-incubator/stat-counters/issues/events{/number}","events_url":"https://api.github.com/repos/bem-incubator/stat-counters/events","assignees_url":"https://api.github.com/repos/bem-incubator/stat-counters/assignees{/user}","branches_url":"https://api.github.com/repos/bem-incubator/stat-counters/branches{/branch}","tags_url":"https://api.github.com/repos/bem-incubator/stat-counters/tags","blobs_url":"https://api.github.com/repos/bem-incubator/stat-counters/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bem-incubator/stat-counters/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bem-incubator/stat-counters/git/refs{/sha}","trees_url":"https://api.github.com/repos/bem-incubator/stat-counters/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bem-incubator/stat-counters/statuses/{sha}","languages_url":"https://api.github.com/repos/bem-incubator/stat-counters/languages","stargazers_url":"https://api.github.com/repos/bem-incubator/stat-counters/stargazers","contributors_url":"https://api.github.com/repos/bem-incubator/stat-counters/contributors","subscribers_url":"https://api.github.com/repos/bem-incubator/stat-counters/subscribers","subscription_url":"https://api.github.com/repos/bem-incubator/stat-counters/subscription","commits_url":"https://api.github.com/repos/bem-incubator/stat-counters/commits{/sha}","git_commits_url":"https://api.github.com/repos/bem-incubator/stat-counters/git/commits{/sha}","comments_url":"https://api.github.com/repos/bem-incubator/stat-counters/comments{/number}","issue_comment_url":"https://api.github.com/repos/bem-incubator/stat-counters/issues/comments{/number}","contents_url":"https://api.github.com/repos/bem-incubator/stat-counters/contents/{+path}","compare_url":"https://api.github.com/repos/bem-incubator/stat-counters/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bem-incubator/stat-counters/merges","archive_url":"https://api.github.com/repos/bem-incubator/stat-counters/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bem-incubator/stat-counters/downloads","issues_url":"https://api.github.com/repos/bem-incubator/stat-counters/issues{/number}","pulls_url":"https://api.github.com/repos/bem-incubator/stat-counters/pulls{/number}","milestones_url":"https://api.github.com/repos/bem-incubator/stat-counters/milestones{/number}","notifications_url":"https://api.github.com/repos/bem-incubator/stat-counters/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bem-incubator/stat-counters/labels{/name}","releases_url":"https://api.github.com/repos/bem-incubator/stat-counters/releases{/id}","deployments_url":"https://api.github.com/repos/bem-incubator/stat-counters/deployments","created_at":"2015-04-10T09:21:50Z","updated_at":"2015-07-01T19:02:15Z","pushed_at":"2016-02-03T23:03:37Z","git_url":"git://github.com/bem-incubator/stat-counters.git","ssh_url":"git@github.com:bem-incubator/stat-counters.git","clone_url":"https://github.com/bem-incubator/stat-counters.git","svn_url":"https://github.com/bem-incubator/stat-counters","homepage":"","size":69,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":9,"forks":5,"open_issues":9,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bem-incubator/stat-counters/pulls/43"},"html":{"href":"https://github.com/bem-incubator/stat-counters/pull/43"},"issue":{"href":"https://api.github.com/repos/bem-incubator/stat-counters/issues/43"},"comments":{"href":"https://api.github.com/repos/bem-incubator/stat-counters/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/bem-incubator/stat-counters/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/bem-incubator/stat-counters/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bem-incubator/stat-counters/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/bem-incubator/stat-counters/statuses/5cc697c540fd3a086d5069f1cb3bd68542c6565c"}}}}