{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/69774494","id":69774494,"diff_hunk":"@@ -0,0 +1,69 @@\n+/**\n+ * Copyright 2016 The AMP HTML Authors. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+import {loadScript, checkData, validateDataExists} from '../3p/3p';\n+\n+const dataKeys = ['site', 'slot', 'options'];\n+const requiredDataKeys = ['site', 'slot'];\n+\n+/**\n+ * @param {!Window} global\n+ * @param {!Object} data\n+ */\n+export function kargo(global, data) {\n+  /*eslint \"google-camelcase/google-camelcase\": 0*/\n+\n+  // validate incoming data\n+  checkData(data, dataKeys);\n+  validateDataExists(data, requiredDataKeys);\n+\n+  // get master amp-ad window\n+  const top = global.context.master;\n+\n+  // Kargo AdTag url\n+  const kargoScriptUrl = 'https://storage.cloud.kargo.com/ad/network/tag/v3/' + data.site + '.js';\n+\n+  // parse extra ad call options (optional)\n+  let options = {};\n+  if (global.JSON && data.options != null) {\n+    try {\n+      options = global.JSON.parse(data.options);\n+    } catch (e) {}\n+  }\n+\n+  // Adding required ad call slot information\n+  options.kargo_id = data.slot;\n+  options.source_window = global;\n+  options.source_element = global.document.body.firstChild;\n+\n+  // Add Kargo AdTag to master window if it has not been loaded or started to load\n+  if (!top.__krg_load_started) {","path":"ads/kargo.js","position":53,"original_position":53,"commit_id":"e197b282ab81f33cc707830c19ee2ce00326509d","original_commit_id":"e197b282ab81f33cc707830c19ee2ce00326509d","user":{"login":"cramforce","id":89679,"avatar_url":"https://avatars.githubusercontent.com/u/89679?v=3","gravatar_id":"","url":"https://api.github.com/users/cramforce","html_url":"https://github.com/cramforce","followers_url":"https://api.github.com/users/cramforce/followers","following_url":"https://api.github.com/users/cramforce/following{/other_user}","gists_url":"https://api.github.com/users/cramforce/gists{/gist_id}","starred_url":"https://api.github.com/users/cramforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cramforce/subscriptions","organizations_url":"https://api.github.com/users/cramforce/orgs","repos_url":"https://api.github.com/users/cramforce/repos","events_url":"https://api.github.com/users/cramforce/events{/privacy}","received_events_url":"https://api.github.com/users/cramforce/received_events","type":"User","site_admin":false},"body":"also the loading for this iframe can never have started yet. Do you want to only load one for N iframes? Check out the `computeInMasterFrame` function.","created_at":"2016-07-06T17:28:50Z","updated_at":"2016-07-06T17:28:50Z","html_url":"https://github.com/ampproject/amphtml/pull/3918#discussion_r69774494","pull_request_url":"https://api.github.com/repos/ampproject/amphtml/pulls/3918","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/69774494"},"html":{"href":"https://github.com/ampproject/amphtml/pull/3918#discussion_r69774494"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/3918"}}},"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/3918","id":76293750,"html_url":"https://github.com/ampproject/amphtml/pull/3918","diff_url":"https://github.com/ampproject/amphtml/pull/3918.diff","patch_url":"https://github.com/ampproject/amphtml/pull/3918.patch","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/3918","number":3918,"state":"open","locked":false,"title":"Adding Kargo ad network support to amp-ad","user":{"login":"andyrusiecki","id":1382487,"avatar_url":"https://avatars.githubusercontent.com/u/1382487?v=3","gravatar_id":"","url":"https://api.github.com/users/andyrusiecki","html_url":"https://github.com/andyrusiecki","followers_url":"https://api.github.com/users/andyrusiecki/followers","following_url":"https://api.github.com/users/andyrusiecki/following{/other_user}","gists_url":"https://api.github.com/users/andyrusiecki/gists{/gist_id}","starred_url":"https://api.github.com/users/andyrusiecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyrusiecki/subscriptions","organizations_url":"https://api.github.com/users/andyrusiecki/orgs","repos_url":"https://api.github.com/users/andyrusiecki/repos","events_url":"https://api.github.com/users/andyrusiecki/events{/privacy}","received_events_url":"https://api.github.com/users/andyrusiecki/received_events","type":"User","site_admin":false},"body":"Adds `kargo` amp-ad type with support for [Kargo](http://www.kargo.com)'s Ad Network.\r\n\r\nIntent to Implement: #3851 ","created_at":"2016-07-05T15:26:00Z","updated_at":"2016-07-06T17:28:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1b5cbf37876a6c6971c4c4f44b4e4de8e2319deb","assignee":{"login":"cramforce","id":89679,"avatar_url":"https://avatars.githubusercontent.com/u/89679?v=3","gravatar_id":"","url":"https://api.github.com/users/cramforce","html_url":"https://github.com/cramforce","followers_url":"https://api.github.com/users/cramforce/followers","following_url":"https://api.github.com/users/cramforce/following{/other_user}","gists_url":"https://api.github.com/users/cramforce/gists{/gist_id}","starred_url":"https://api.github.com/users/cramforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cramforce/subscriptions","organizations_url":"https://api.github.com/users/cramforce/orgs","repos_url":"https://api.github.com/users/cramforce/repos","events_url":"https://api.github.com/users/cramforce/events{/privacy}","received_events_url":"https://api.github.com/users/cramforce/received_events","type":"User","site_admin":false},"assignees":[{"login":"cramforce","id":89679,"avatar_url":"https://avatars.githubusercontent.com/u/89679?v=3","gravatar_id":"","url":"https://api.github.com/users/cramforce","html_url":"https://github.com/cramforce","followers_url":"https://api.github.com/users/cramforce/followers","following_url":"https://api.github.com/users/cramforce/following{/other_user}","gists_url":"https://api.github.com/users/cramforce/gists{/gist_id}","starred_url":"https://api.github.com/users/cramforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cramforce/subscriptions","organizations_url":"https://api.github.com/users/cramforce/orgs","repos_url":"https://api.github.com/users/cramforce/repos","events_url":"https://api.github.com/users/cramforce/events{/privacy}","received_events_url":"https://api.github.com/users/cramforce/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amphtml/pulls/3918/commits","review_comments_url":"https://api.github.com/repos/ampproject/amphtml/pulls/3918/comments","review_comment_url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/3918/comments","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/e197b282ab81f33cc707830c19ee2ce00326509d","head":{"label":"KargoGlobal:kargo/amp-ad","ref":"kargo/amp-ad","sha":"e197b282ab81f33cc707830c19ee2ce00326509d","user":{"login":"KargoGlobal","id":6718730,"avatar_url":"https://avatars.githubusercontent.com/u/6718730?v=3","gravatar_id":"","url":"https://api.github.com/users/KargoGlobal","html_url":"https://github.com/KargoGlobal","followers_url":"https://api.github.com/users/KargoGlobal/followers","following_url":"https://api.github.com/users/KargoGlobal/following{/other_user}","gists_url":"https://api.github.com/users/KargoGlobal/gists{/gist_id}","starred_url":"https://api.github.com/users/KargoGlobal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KargoGlobal/subscriptions","organizations_url":"https://api.github.com/users/KargoGlobal/orgs","repos_url":"https://api.github.com/users/KargoGlobal/repos","events_url":"https://api.github.com/users/KargoGlobal/events{/privacy}","received_events_url":"https://api.github.com/users/KargoGlobal/received_events","type":"Organization","site_admin":false},"repo":{"id":61587134,"name":"amphtml","full_name":"KargoGlobal/amphtml","owner":{"login":"KargoGlobal","id":6718730,"avatar_url":"https://avatars.githubusercontent.com/u/6718730?v=3","gravatar_id":"","url":"https://api.github.com/users/KargoGlobal","html_url":"https://github.com/KargoGlobal","followers_url":"https://api.github.com/users/KargoGlobal/followers","following_url":"https://api.github.com/users/KargoGlobal/following{/other_user}","gists_url":"https://api.github.com/users/KargoGlobal/gists{/gist_id}","starred_url":"https://api.github.com/users/KargoGlobal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KargoGlobal/subscriptions","organizations_url":"https://api.github.com/users/KargoGlobal/orgs","repos_url":"https://api.github.com/users/KargoGlobal/repos","events_url":"https://api.github.com/users/KargoGlobal/events{/privacy}","received_events_url":"https://api.github.com/users/KargoGlobal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KargoGlobal/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":true,"url":"https://api.github.com/repos/KargoGlobal/amphtml","forks_url":"https://api.github.com/repos/KargoGlobal/amphtml/forks","keys_url":"https://api.github.com/repos/KargoGlobal/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KargoGlobal/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KargoGlobal/amphtml/teams","hooks_url":"https://api.github.com/repos/KargoGlobal/amphtml/hooks","issue_events_url":"https://api.github.com/repos/KargoGlobal/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/KargoGlobal/amphtml/events","assignees_url":"https://api.github.com/repos/KargoGlobal/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/KargoGlobal/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/KargoGlobal/amphtml/tags","blobs_url":"https://api.github.com/repos/KargoGlobal/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KargoGlobal/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KargoGlobal/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/KargoGlobal/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KargoGlobal/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/KargoGlobal/amphtml/languages","stargazers_url":"https://api.github.com/repos/KargoGlobal/amphtml/stargazers","contributors_url":"https://api.github.com/repos/KargoGlobal/amphtml/contributors","subscribers_url":"https://api.github.com/repos/KargoGlobal/amphtml/subscribers","subscription_url":"https://api.github.com/repos/KargoGlobal/amphtml/subscription","commits_url":"https://api.github.com/repos/KargoGlobal/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/KargoGlobal/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/KargoGlobal/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/KargoGlobal/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/KargoGlobal/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/KargoGlobal/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KargoGlobal/amphtml/merges","archive_url":"https://api.github.com/repos/KargoGlobal/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KargoGlobal/amphtml/downloads","issues_url":"https://api.github.com/repos/KargoGlobal/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/KargoGlobal/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/KargoGlobal/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/KargoGlobal/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KargoGlobal/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/KargoGlobal/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/KargoGlobal/amphtml/deployments","created_at":"2016-06-20T23:24:01Z","updated_at":"2016-06-20T23:24:04Z","pushed_at":"2016-07-06T15:53:05Z","git_url":"git://github.com/KargoGlobal/amphtml.git","ssh_url":"git@github.com:KargoGlobal/amphtml.git","clone_url":"https://github.com/KargoGlobal/amphtml.git","svn_url":"https://github.com/KargoGlobal/amphtml","homepage":"https://ampproject.org","size":110568,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"ampproject:master","ref":"master","sha":"2f4e98715dce965d7587f770ef9e600618eba8d9","user":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"repo":{"id":41766002,"name":"amphtml","full_name":"ampproject/amphtml","owner":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ampproject/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":false,"url":"https://api.github.com/repos/ampproject/amphtml","forks_url":"https://api.github.com/repos/ampproject/amphtml/forks","keys_url":"https://api.github.com/repos/ampproject/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampproject/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampproject/amphtml/teams","hooks_url":"https://api.github.com/repos/ampproject/amphtml/hooks","issue_events_url":"https://api.github.com/repos/ampproject/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/ampproject/amphtml/events","assignees_url":"https://api.github.com/repos/ampproject/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/ampproject/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/ampproject/amphtml/tags","blobs_url":"https://api.github.com/repos/ampproject/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampproject/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampproject/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampproject/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/ampproject/amphtml/languages","stargazers_url":"https://api.github.com/repos/ampproject/amphtml/stargazers","contributors_url":"https://api.github.com/repos/ampproject/amphtml/contributors","subscribers_url":"https://api.github.com/repos/ampproject/amphtml/subscribers","subscription_url":"https://api.github.com/repos/ampproject/amphtml/subscription","commits_url":"https://api.github.com/repos/ampproject/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampproject/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampproject/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampproject/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampproject/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/ampproject/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampproject/amphtml/merges","archive_url":"https://api.github.com/repos/ampproject/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampproject/amphtml/downloads","issues_url":"https://api.github.com/repos/ampproject/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/ampproject/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/ampproject/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/ampproject/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampproject/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/ampproject/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/ampproject/amphtml/deployments","created_at":"2015-09-01T22:10:53Z","updated_at":"2016-07-06T12:44:52Z","pushed_at":"2016-07-06T17:20:00Z","git_url":"git://github.com/ampproject/amphtml.git","ssh_url":"git@github.com:ampproject/amphtml.git","clone_url":"https://github.com/ampproject/amphtml.git","svn_url":"https://github.com/ampproject/amphtml","homepage":"https://ampproject.org","size":126475,"stargazers_count":7831,"watchers_count":7831,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1098,"mirror_url":null,"open_issues_count":573,"forks":1098,"open_issues":573,"watchers":7831,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/3918"},"html":{"href":"https://github.com/ampproject/amphtml/pull/3918"},"issue":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/3918"},"comments":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/3918/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/3918/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/3918/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amphtml/statuses/e197b282ab81f33cc707830c19ee2ce00326509d"}}}}
{"actor":{"display_login":"cramforce"}}