{"action":"created","comment":{"url":"https://api.github.com/repos/prebid/Prebid.js/pulls/comments/203060780","pull_request_review_id":137876807,"id":203060780,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzA2MDc4MA==","diff_hunk":"@@ -0,0 +1,157 @@\n+import * as utils from 'src/utils';\n+import { registerBidder } from 'src/adapters/bidderFactory';\n+import { config } from 'src/config';\n+\n+const pixKey = 'utrk';\n+\n+function startsWith(str, search) {\n+  return str.substr(0, search.length) === search;\n+}\n+\n+export const spec = {\n+  code: 'yieldnexus',\n+  aliases: [],\n+  supportedMediaTypes: ['banner', 'video'],\n+\n+  isBidRequestValid: function(bid) {\n+    if (!bid.params.spid) {\n+      return false;\n+    } else if (typeof bid.params.spid !== 'string') {\n+      return false;\n+    }\n+    return (typeof bid.params.instl === 'undefined' || bid.params.instl === 0 || bid.params.instl === 1) &&\n+           (typeof bid.params.bidfloor === 'undefined' || typeof bid.params.bidfloor === 'number') &&\n+           (typeof bid.params['protocols'] === 'undefined' || Array.isArray(bid.params['protocols'])) &&\n+           (typeof bid.params['adpos'] === 'undefined' || typeof bid.params['adpos'] === 'number');\n+  },\n+\n+  buildRequests: function(validBidRequests, bidderRequest) {\n+    return validBidRequests.map(bidRequest => {\n+      let referrer = '';\n+      try {\n+        referrer = window.top.document.referrer;\n+      } catch (e) {\n+        try {\n+          referrer = window.document.referrer;\n+        } catch (e) {\n+        }\n+      }\n+      const url = utils.getTopWindowUrl();\n+      const domainStart = url.indexOf('://') + 3;\n+      const req = {\n+        id: bidRequest.auctionId,\n+        site: {\n+          domain: url.substring(domainStart, url.indexOf('/', domainStart) < 0 ? url.length : url.indexOf('/', domainStart)),\n+          page: config.getConfig('pageUrl') || utils.getTopWindowUrl(),","path":"modules/yieldNexusBidAdapter.js","position":45,"original_position":45,"commit_id":"54bc085a78a0a157c38147467b55a9201f554317","original_commit_id":"54bc085a78a0a157c38147467b55a9201f554317","user":{"login":"jsnellbaker","id":31102355,"node_id":"MDQ6VXNlcjMxMTAyMzU1","avatar_url":"https://avatars1.githubusercontent.com/u/31102355?v=4","gravatar_id":"","url":"https://api.github.com/users/jsnellbaker","html_url":"https://github.com/jsnellbaker","followers_url":"https://api.github.com/users/jsnellbaker/followers","following_url":"https://api.github.com/users/jsnellbaker/following{/other_user}","gists_url":"https://api.github.com/users/jsnellbaker/gists{/gist_id}","starred_url":"https://api.github.com/users/jsnellbaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsnellbaker/subscriptions","organizations_url":"https://api.github.com/users/jsnellbaker/orgs","repos_url":"https://api.github.com/users/jsnellbaker/repos","events_url":"https://api.github.com/users/jsnellbaker/events{/privacy}","received_events_url":"https://api.github.com/users/jsnellbaker/received_events","type":"User","site_admin":false},"body":"I don't believe `config.getConfig('pageUrl')` will ever return anything; so it could potentially be removed.\r\n\r\nAdditionally, it seems like you already obtain the result from `utils.getTopWindowUrl()` for the `url` variable a little above.  Could you reuse that variable here for the `page` parameter?","created_at":"2018-07-17T15:08:24Z","updated_at":"2018-07-17T15:44:22Z","html_url":"https://github.com/prebid/Prebid.js/pull/2855#discussion_r203060780","pull_request_url":"https://api.github.com/repos/prebid/Prebid.js/pulls/2855","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/prebid/Prebid.js/pulls/comments/203060780"},"html":{"href":"https://github.com/prebid/Prebid.js/pull/2855#discussion_r203060780"},"pull_request":{"href":"https://api.github.com/repos/prebid/Prebid.js/pulls/2855"}}},"pull_request":{"url":"https://api.github.com/repos/prebid/Prebid.js/pulls/2855","id":201684173,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNjg0MTcz","html_url":"https://github.com/prebid/Prebid.js/pull/2855","diff_url":"https://github.com/prebid/Prebid.js/pull/2855.diff","patch_url":"https://github.com/prebid/Prebid.js/pull/2855.patch","issue_url":"https://api.github.com/repos/prebid/Prebid.js/issues/2855","number":2855,"state":"open","locked":false,"title":"YieldNexus Bid Adapter v1","user":{"login":"ericyld","id":41298164,"node_id":"MDQ6VXNlcjQxMjk4MTY0","avatar_url":"https://avatars1.githubusercontent.com/u/41298164?v=4","gravatar_id":"","url":"https://api.github.com/users/ericyld","html_url":"https://github.com/ericyld","followers_url":"https://api.github.com/users/ericyld/followers","following_url":"https://api.github.com/users/ericyld/following{/other_user}","gists_url":"https://api.github.com/users/ericyld/gists{/gist_id}","starred_url":"https://api.github.com/users/ericyld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericyld/subscriptions","organizations_url":"https://api.github.com/users/ericyld/orgs","repos_url":"https://api.github.com/users/ericyld/repos","events_url":"https://api.github.com/users/ericyld/events{/privacy}","received_events_url":"https://api.github.com/users/ericyld/received_events","type":"User","site_admin":false},"body":"## Type of change\r\n- [ ] Bugfix\r\n- [ ] Feature\r\n- [x] New bidder adapter\r\n- [ ] Code style update (formatting, local variables)\r\n- [ ] Refactoring (no functional changes, no api changes)\r\n- [ ] Build related changes\r\n- [ ] CI related changes\r\n- [ ] Does this change affect user-facing APIs or examples documented on http://prebid.org?\r\n- [ ] Other\r\n\r\n## Description of change\r\nAdd the YieldNexus Bid Adapter.\r\n\r\nTest parameters:\r\n```\r\n{\r\n  bidder: 'gambid',\r\n  params: {\r\n    spid: \"1234\"\r\n  }\r\n}\r\n```\r\nContact email of the adapter’s maintainer: rtbops@yieldnexus.com","created_at":"2018-07-16T16:00:27Z","updated_at":"2018-07-17T15:44:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05267fdfc07ef7f0b85f6c45759af43403a1e838","assignee":{"login":"jsnellbaker","id":31102355,"node_id":"MDQ6VXNlcjMxMTAyMzU1","avatar_url":"https://avatars1.githubusercontent.com/u/31102355?v=4","gravatar_id":"","url":"https://api.github.com/users/jsnellbaker","html_url":"https://github.com/jsnellbaker","followers_url":"https://api.github.com/users/jsnellbaker/followers","following_url":"https://api.github.com/users/jsnellbaker/following{/other_user}","gists_url":"https://api.github.com/users/jsnellbaker/gists{/gist_id}","starred_url":"https://api.github.com/users/jsnellbaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsnellbaker/subscriptions","organizations_url":"https://api.github.com/users/jsnellbaker/orgs","repos_url":"https://api.github.com/users/jsnellbaker/repos","events_url":"https://api.github.com/users/jsnellbaker/events{/privacy}","received_events_url":"https://api.github.com/users/jsnellbaker/received_events","type":"User","site_admin":false},"assignees":[{"login":"jsnellbaker","id":31102355,"node_id":"MDQ6VXNlcjMxMTAyMzU1","avatar_url":"https://avatars1.githubusercontent.com/u/31102355?v=4","gravatar_id":"","url":"https://api.github.com/users/jsnellbaker","html_url":"https://github.com/jsnellbaker","followers_url":"https://api.github.com/users/jsnellbaker/followers","following_url":"https://api.github.com/users/jsnellbaker/following{/other_user}","gists_url":"https://api.github.com/users/jsnellbaker/gists{/gist_id}","starred_url":"https://api.github.com/users/jsnellbaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsnellbaker/subscriptions","organizations_url":"https://api.github.com/users/jsnellbaker/orgs","repos_url":"https://api.github.com/users/jsnellbaker/repos","events_url":"https://api.github.com/users/jsnellbaker/events{/privacy}","received_events_url":"https://api.github.com/users/jsnellbaker/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":778096712,"node_id":"MDU6TGFiZWw3NzgwOTY3MTI=","url":"https://api.github.com/repos/prebid/Prebid.js/labels/needs%20docs","name":"needs docs","color":"f3f704","default":false},{"id":330241685,"node_id":"MDU6TGFiZWwzMzAyNDE2ODU=","url":"https://api.github.com/repos/prebid/Prebid.js/labels/needs%20review","name":"needs review","color":"e11d21","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/prebid/Prebid.js/pulls/2855/commits","review_comments_url":"https://api.github.com/repos/prebid/Prebid.js/pulls/2855/comments","review_comment_url":"https://api.github.com/repos/prebid/Prebid.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prebid/Prebid.js/issues/2855/comments","statuses_url":"https://api.github.com/repos/prebid/Prebid.js/statuses/54bc085a78a0a157c38147467b55a9201f554317","head":{"label":"yieldnexus:yieldnexus-bidadapter","ref":"yieldnexus-bidadapter","sha":"54bc085a78a0a157c38147467b55a9201f554317","user":{"login":"yieldnexus","id":40472185,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNDcyMTg1","avatar_url":"https://avatars0.githubusercontent.com/u/40472185?v=4","gravatar_id":"","url":"https://api.github.com/users/yieldnexus","html_url":"https://github.com/yieldnexus","followers_url":"https://api.github.com/users/yieldnexus/followers","following_url":"https://api.github.com/users/yieldnexus/following{/other_user}","gists_url":"https://api.github.com/users/yieldnexus/gists{/gist_id}","starred_url":"https://api.github.com/users/yieldnexus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yieldnexus/subscriptions","organizations_url":"https://api.github.com/users/yieldnexus/orgs","repos_url":"https://api.github.com/users/yieldnexus/repos","events_url":"https://api.github.com/users/yieldnexus/events{/privacy}","received_events_url":"https://api.github.com/users/yieldnexus/received_events","type":"Organization","site_admin":false},"repo":{"id":141153105,"node_id":"MDEwOlJlcG9zaXRvcnkxNDExNTMxMDU=","name":"Prebid.js","full_name":"yieldnexus/Prebid.js","owner":{"login":"yieldnexus","id":40472185,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwNDcyMTg1","avatar_url":"https://avatars0.githubusercontent.com/u/40472185?v=4","gravatar_id":"","url":"https://api.github.com/users/yieldnexus","html_url":"https://github.com/yieldnexus","followers_url":"https://api.github.com/users/yieldnexus/followers","following_url":"https://api.github.com/users/yieldnexus/following{/other_user}","gists_url":"https://api.github.com/users/yieldnexus/gists{/gist_id}","starred_url":"https://api.github.com/users/yieldnexus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yieldnexus/subscriptions","organizations_url":"https://api.github.com/users/yieldnexus/orgs","repos_url":"https://api.github.com/users/yieldnexus/repos","events_url":"https://api.github.com/users/yieldnexus/events{/privacy}","received_events_url":"https://api.github.com/users/yieldnexus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yieldnexus/Prebid.js","description":"Setup and manage header bidding advertising partners without writing code or confusing line items. Prebid.js is open source and free.","fork":true,"url":"https://api.github.com/repos/yieldnexus/Prebid.js","forks_url":"https://api.github.com/repos/yieldnexus/Prebid.js/forks","keys_url":"https://api.github.com/repos/yieldnexus/Prebid.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yieldnexus/Prebid.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yieldnexus/Prebid.js/teams","hooks_url":"https://api.github.com/repos/yieldnexus/Prebid.js/hooks","issue_events_url":"https://api.github.com/repos/yieldnexus/Prebid.js/issues/events{/number}","events_url":"https://api.github.com/repos/yieldnexus/Prebid.js/events","assignees_url":"https://api.github.com/repos/yieldnexus/Prebid.js/assignees{/user}","branches_url":"https://api.github.com/repos/yieldnexus/Prebid.js/branches{/branch}","tags_url":"https://api.github.com/repos/yieldnexus/Prebid.js/tags","blobs_url":"https://api.github.com/repos/yieldnexus/Prebid.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yieldnexus/Prebid.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yieldnexus/Prebid.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/yieldnexus/Prebid.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yieldnexus/Prebid.js/statuses/{sha}","languages_url":"https://api.github.com/repos/yieldnexus/Prebid.js/languages","stargazers_url":"https://api.github.com/repos/yieldnexus/Prebid.js/stargazers","contributors_url":"https://api.github.com/repos/yieldnexus/Prebid.js/contributors","subscribers_url":"https://api.github.com/repos/yieldnexus/Prebid.js/subscribers","subscription_url":"https://api.github.com/repos/yieldnexus/Prebid.js/subscription","commits_url":"https://api.github.com/repos/yieldnexus/Prebid.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/yieldnexus/Prebid.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/yieldnexus/Prebid.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/yieldnexus/Prebid.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/yieldnexus/Prebid.js/contents/{+path}","compare_url":"https://api.github.com/repos/yieldnexus/Prebid.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yieldnexus/Prebid.js/merges","archive_url":"https://api.github.com/repos/yieldnexus/Prebid.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yieldnexus/Prebid.js/downloads","issues_url":"https://api.github.com/repos/yieldnexus/Prebid.js/issues{/number}","pulls_url":"https://api.github.com/repos/yieldnexus/Prebid.js/pulls{/number}","milestones_url":"https://api.github.com/repos/yieldnexus/Prebid.js/milestones{/number}","notifications_url":"https://api.github.com/repos/yieldnexus/Prebid.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yieldnexus/Prebid.js/labels{/name}","releases_url":"https://api.github.com/repos/yieldnexus/Prebid.js/releases{/id}","deployments_url":"https://api.github.com/repos/yieldnexus/Prebid.js/deployments","created_at":"2018-07-16T14:51:22Z","updated_at":"2018-07-16T14:51:25Z","pushed_at":"2018-07-16T15:50:49Z","git_url":"git://github.com/yieldnexus/Prebid.js.git","ssh_url":"git@github.com:yieldnexus/Prebid.js.git","clone_url":"https://github.com/yieldnexus/Prebid.js.git","svn_url":"https://github.com/yieldnexus/Prebid.js","homepage":"http://prebid.org","size":7568,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"prebid:master","ref":"master","sha":"f32605ab23356653b31b6087850443a21b1a3326","user":{"login":"prebid","id":13242760,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMjQyNzYw","avatar_url":"https://avatars1.githubusercontent.com/u/13242760?v=4","gravatar_id":"","url":"https://api.github.com/users/prebid","html_url":"https://github.com/prebid","followers_url":"https://api.github.com/users/prebid/followers","following_url":"https://api.github.com/users/prebid/following{/other_user}","gists_url":"https://api.github.com/users/prebid/gists{/gist_id}","starred_url":"https://api.github.com/users/prebid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prebid/subscriptions","organizations_url":"https://api.github.com/users/prebid/orgs","repos_url":"https://api.github.com/users/prebid/repos","events_url":"https://api.github.com/users/prebid/events{/privacy}","received_events_url":"https://api.github.com/users/prebid/received_events","type":"Organization","site_admin":false},"repo":{"id":39321023,"node_id":"MDEwOlJlcG9zaXRvcnkzOTMyMTAyMw==","name":"Prebid.js","full_name":"prebid/Prebid.js","owner":{"login":"prebid","id":13242760,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMjQyNzYw","avatar_url":"https://avatars1.githubusercontent.com/u/13242760?v=4","gravatar_id":"","url":"https://api.github.com/users/prebid","html_url":"https://github.com/prebid","followers_url":"https://api.github.com/users/prebid/followers","following_url":"https://api.github.com/users/prebid/following{/other_user}","gists_url":"https://api.github.com/users/prebid/gists{/gist_id}","starred_url":"https://api.github.com/users/prebid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prebid/subscriptions","organizations_url":"https://api.github.com/users/prebid/orgs","repos_url":"https://api.github.com/users/prebid/repos","events_url":"https://api.github.com/users/prebid/events{/privacy}","received_events_url":"https://api.github.com/users/prebid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prebid/Prebid.js","description":"Setup and manage header bidding advertising partners without writing code or confusing line items. Prebid.js is open source and free.","fork":false,"url":"https://api.github.com/repos/prebid/Prebid.js","forks_url":"https://api.github.com/repos/prebid/Prebid.js/forks","keys_url":"https://api.github.com/repos/prebid/Prebid.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prebid/Prebid.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prebid/Prebid.js/teams","hooks_url":"https://api.github.com/repos/prebid/Prebid.js/hooks","issue_events_url":"https://api.github.com/repos/prebid/Prebid.js/issues/events{/number}","events_url":"https://api.github.com/repos/prebid/Prebid.js/events","assignees_url":"https://api.github.com/repos/prebid/Prebid.js/assignees{/user}","branches_url":"https://api.github.com/repos/prebid/Prebid.js/branches{/branch}","tags_url":"https://api.github.com/repos/prebid/Prebid.js/tags","blobs_url":"https://api.github.com/repos/prebid/Prebid.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prebid/Prebid.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prebid/Prebid.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/prebid/Prebid.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prebid/Prebid.js/statuses/{sha}","languages_url":"https://api.github.com/repos/prebid/Prebid.js/languages","stargazers_url":"https://api.github.com/repos/prebid/Prebid.js/stargazers","contributors_url":"https://api.github.com/repos/prebid/Prebid.js/contributors","subscribers_url":"https://api.github.com/repos/prebid/Prebid.js/subscribers","subscription_url":"https://api.github.com/repos/prebid/Prebid.js/subscription","commits_url":"https://api.github.com/repos/prebid/Prebid.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/prebid/Prebid.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/prebid/Prebid.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/prebid/Prebid.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/prebid/Prebid.js/contents/{+path}","compare_url":"https://api.github.com/repos/prebid/Prebid.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prebid/Prebid.js/merges","archive_url":"https://api.github.com/repos/prebid/Prebid.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prebid/Prebid.js/downloads","issues_url":"https://api.github.com/repos/prebid/Prebid.js/issues{/number}","pulls_url":"https://api.github.com/repos/prebid/Prebid.js/pulls{/number}","milestones_url":"https://api.github.com/repos/prebid/Prebid.js/milestones{/number}","notifications_url":"https://api.github.com/repos/prebid/Prebid.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prebid/Prebid.js/labels{/name}","releases_url":"https://api.github.com/repos/prebid/Prebid.js/releases{/id}","deployments_url":"https://api.github.com/repos/prebid/Prebid.js/deployments","created_at":"2015-07-19T03:26:23Z","updated_at":"2018-07-17T14:39:46Z","pushed_at":"2018-07-17T14:17:10Z","git_url":"git://github.com/prebid/Prebid.js.git","ssh_url":"git@github.com:prebid/Prebid.js.git","clone_url":"https://github.com/prebid/Prebid.js.git","svn_url":"https://github.com/prebid/Prebid.js","homepage":"http://prebid.org","size":7563,"stargazers_count":691,"watchers_count":691,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":744,"mirror_url":null,"archived":false,"open_issues_count":88,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":744,"open_issues":88,"watchers":691,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prebid/Prebid.js/pulls/2855"},"html":{"href":"https://github.com/prebid/Prebid.js/pull/2855"},"issue":{"href":"https://api.github.com/repos/prebid/Prebid.js/issues/2855"},"comments":{"href":"https://api.github.com/repos/prebid/Prebid.js/issues/2855/comments"},"review_comments":{"href":"https://api.github.com/repos/prebid/Prebid.js/pulls/2855/comments"},"review_comment":{"href":"https://api.github.com/repos/prebid/Prebid.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prebid/Prebid.js/pulls/2855/commits"},"statuses":{"href":"https://api.github.com/repos/prebid/Prebid.js/statuses/54bc085a78a0a157c38147467b55a9201f554317"}},"author_association":"NONE"}}
{"actor":{"display_login":"jsnellbaker"}}