Skip to content

Commit

Permalink
Remove unused method, key value and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Li Xinyang committed Oct 25, 2017
1 parent b95315f commit 1322e00
Showing 1 changed file with 14 additions and 29 deletions.
43 changes: 14 additions & 29 deletions modules/quantcastBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as utils from 'src/utils';
import { registerBidder } from 'src/adapters/bidderFactory';
import * as utils from "src/utils";
import { registerBidder } from "src/adapters/bidderFactory";

const BIDDER_CODE = 'quantcast';
const BIDDER_CODE = "quantcast";
const DEFAULT_BID_FLOOR = 0.0000000001;
export const QUANTCAST_CALLBACK_URL = 'global.qc.rtb.quantserve.com';
export const QUANTCAST_CALLBACK_URL_TEST = 's2s-canary.quantserve.com';
export const QUANTCAST_TEST_PUBLISHER = 'test-publisher';
export const QUANTCAST_CALLBACK_URL = "global.qc.rtb.quantserve.com";
export const QUANTCAST_CALLBACK_URL_TEST = "s2s-canary.quantserve.com";
export const QUANTCAST_TEST_PUBLISHER = "test-publisher";

/**
* The documentation for Prebid.js Adapter 1.0 can be found at link below,
Expand All @@ -14,14 +14,6 @@ export const QUANTCAST_TEST_PUBLISHER = 'test-publisher';
export const spec = {
code: BIDDER_CODE,

// `BaseAdapter` model saves adapter from having to make the AJAX call
// provides consistency adapter structure.
// `BaseAdapter` defines 4 entry points,
// - `isBidRequestValid`
// - `buildRequests`
// - `interpretResponse`
// - `getUserSyncs`

/**
* Verify the `AdUnits.bids` response with `true` for valid request and `false`
* for invalid request.
Expand All @@ -34,7 +26,7 @@ export const spec = {
return false;
}

if (bid.mediaType === 'video') {
if (bid.mediaType === "video") {
return false;
}

Expand All @@ -61,7 +53,7 @@ export const spec = {
// Switch the callback URL to Quantcast Canary Endpoint for testing purpose
// `//` is not used because we have different port setting at our end
switch (window.location.protocol) {
case 'https:':
case "https:":
publisherTagURL = `https://${QUANTCAST_CALLBACK_URL}:8443/qchb`;
publisherTagURLTest = `https://${QUANTCAST_CALLBACK_URL_TEST}:8443/qchb`;
break;
Expand Down Expand Up @@ -111,9 +103,8 @@ export const spec = {

return {
data,
method: 'POST',
url,
withCredentials: true
method: "POST",
url
};
});

Expand All @@ -136,32 +127,26 @@ export const spec = {

if (
response === undefined ||
!response.hasOwnProperty('bids') ||
!response.hasOwnProperty("bids") ||
utils.isEmpty(response.bids)
) {
utils.logError('Sub-optimal JSON received from Quantcast server');
utils.logError("Sub-optimal JSON received from Quantcast server");
return [];
}

const bidResponsesList = response.bids.map(bid => {
const { ad, cpm, width, height } = bid;

return {
ad,
requestId: response.requestId,
cpm,
width,
height,
requestId: response.requestId,
bidderCode: response.bidderCode || BIDDER_CODE
ad
};
});

return bidResponsesList;
},

getUserSyncs(syncOptions) {
// Quantcast does not do `UserSyncs` at the moment.
// This feature will be supported at a later time.
}
};

Expand Down

0 comments on commit 1322e00

Please sign in to comment.