modules/brainyBidAdapter.js
function(validBidRequests) {
    var bidRequests = [];
    for (var i = 0, len = validBidRequests.length; i < len; i++) {
      var bid = validBidRequests[i];
      var accountID = utils.getBidIdParameter('accountID', bid.params);
      var slotID = utils.getBidIdParameter('slotID', bid.params);
      var url = utils.getTopWindowUrl();
      var flash = _getFlash();
      var nocache = new Date().getTime() + Math.floor(Math.random() * 100000000);
      var requestURL;

      requestURL = '_aid=' + accountID + '&';
      requestURL += '_slot=' + slotID + '&';
      requestURL += '_url=' + url + '&';
      requestURL += '_flash=' + flash + '&';
      requestURL += '_nocache=' + nocache;

      bidRequests.push({
        method: 'GET',
        url: BASE_URL,
        data: requestURL,
        bidRequest: bid
      })
    }
    return bidRequests;
  }
function(validBidRequests) {
    var bidRequests = [];
    for (var i = 0, len = validBidRequests.length; i < len; i++) {
      var bid = validBidRequests[i];
      var accountID = utils.getBidIdParameter('accountID', bid.params);
      var slotID = utils.getBidIdParameter('slotID', bid.params);
      var url = utils.getTopWindowUrl();
      var flash = _getFlash();
      var nocache = new Date().getTime() + Math.floor(Math.random() * 100000000);
      var requestURL;

      requestURL = '_aid=' + accountID + '&';
      requestURL += '_slot=' + slotID + '&';
      requestURL += '_url=' + url + '&';
      requestURL += '_flash=' + flash + '&';
      requestURL += '_nocache=' + nocache;

      bidRequests.push({
        method: 'GET',
        url: BASE_URL,
        data: requestURL,
        bidRequest: bid
      })
    }
    return bidRequests;
  }
function ( validBidRequests ) { var bidRequests = [ ] ; for ( var i = 0 , len = validBidRequests . length ; i < len ; i ++ ) { var bid = validBidRequests [ i ] ; var accountID = utils . getBidIdParameter ( 'accountID' , bid . params ) ; var slotID = utils . getBidIdParameter ( 'slotID' , bid . params ) ; var url = utils . getTopWindowUrl ( ) ; var flash = _getFlash ( ) ; var nocache = new Date ( ) . getTime ( ) + Math . floor ( Math . random ( ) * 100000000 ) ; var requestURL ; requestURL = '_aid=' + accountID + '&' ; requestURL += '_slot=' + slotID + '&' ; requestURL += '_url=' + url + '&' ; requestURL += '_flash=' + flash + '&' ; requestURL += '_nocache=' + nocache ; bidRequests . push ( { method : 'GET' , url : BASE_URL , data : requestURL , bidRequest : bid } ) } return bidRequests ; }
Format the bid request object for our endpoint
@param  {BidRequest[]} bidRequests Array of brainy bidders
@return object of parameters for Prebid AJAX request
 
入札リクエストをbrainyに対応するように整形する
@param  {BidRequest[]} bidRequests 入札のための配列
@return Prebid AJAX用に整形したオブジェクト
Format the bid request object for our endpoint