An unexpected error has occurred!
Error Message:The remote server returned an error: (403) Forbidden.
 
Description:An unexpected error occurred during the execution of the page.
 
line 0, column 0
Exception Info:
An error occurred when attempting to execute a Javascript block. See inner exception for detail.
  Script: 
Platform.Load("core","1.1.1");
var COMP_EXP = 'COMPETITION_';
var COMP_METADATA = "NDM_Competition_Master_DB_DE";
var NDM_SITE_FURNITURE = "NDM_SiteFurniture_DB_DE";
var LAST_V1_COMP = 309;//this should be changed during release

var GetContent = function(sde,row){
	var currentTime = Now();
	var cacheExpiryTime = currentTime.setMinutes(currentTime.getMinutes() - 30);
	var cachedTime = new Date(row.LastCachedDate);

	if( row.LastCachedDate === "" || cachedTime.getTime() < cacheExpiryTime.getTime() || row.CachedHTML === ""){
		var content = HTTP.Get(row.URL).Content;	
		sde.Rows.Update({CachedHTML:content,LastCachedDate:Now()},["Affiliate","URLType"],[row.Affiliate,row.URLType]);	
		return content;	
	} else {
		return row.CachedHTML;
	}
};

var p = Request.GetQueryStringParameter("p");
if (p != null) {
	var compPattern = /COMPETITION_/;
	var id = null;
	var name = "";
	var comp = "";

	if(compPattern.test(p)){
		id= p.replace(COMP_EXP, '');
	}else{
		var index = p.indexOf("_");
		id = p.substring(0,index);
		name = p.substring(index+1,p.length);
	}

	var comp = COMP_EXP + id;

	var de = DataExtension.Init(COMP_METADATA);
	var rows = [];
	if(parseInt(id) > LAST_V1_COMP){
		rows = de.Rows.Retrieve({LeftOperand:{Property: "Id",SimpleOperator: "equals",Value: id},LogicalOperator:"AND",RightOperand:{Property: "Name",SimpleOperator: "equals",Value: name}});
	} else {
		rows = de.Rows.Retrieve({Property: "Id",SimpleOperator: "equals",Value: id});
	}


	if (rows.length > 0) {
		var affiliate = rows[0].Affiliate;
		var siteFurniture = rows[0].SiteFurniture;
		var siteFurnitureURL = rows[0].SiteFurnitureURL;
		var customCSSURL = rows[0].CustomCSSURL;
		var competitionHTML = ContentAreaObj.Retrieve({Property: "CustomerKey",SimpleOperator: "equals",Value:comp})[0]["Content"];
		var siteFurnitureHTML = "";
		var baseURL = "";
		var mobilemeta = '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">';

		var titleAffiliate = affiliate;
		if(titleAffiliate === "Adelaide Now"){
			titleAffiliate = "The Advertiser";
		} 


		if (siteFurniture == "True") {
			if (siteFurnitureURL == "") {
				var content3divStart = '<div id="content-3">';
				var content3divEnd = '</div>';
				var isFatWire = true;

				var header = "";
				var footer = "";
				var fullPage = "";

				var sde = DataExtension.Init(NDM_SITE_FURNITURE);
				var filter = {Property:"Affiliate",SimpleOperator:"equals",Value:affiliate};        
Variable.SetValue("aff",affiliate);

    Platform.WriteVirtualContentArea(1);

	
				var sRow = new Object();
				sRow.Affiliate = affiliate;
				sRow.URL = Variable.GetValue("@URL");
				sRow.URLType = Variable.GetValue("@URLType");
				sRow.IsFatWire = Variable.GetValue("@IsFatWire");
				sRow.bodyCSSClass = Variable.GetValue("@bodyCSSClass");
				sRow.CachedHTML = Variable.GetValue("@CachedHTML");
				sRow.LastCachedDate = Variable.GetValue("@LastCachedDate");
					isFatWire = sRow.IsFatWire;
			
					if(sRow.URLType == "header"){
						header = GetContent(sde,sRow);
					}else if(sRow.URLType == "footer"){
						footer = GetContent(sde,sRow);
					}else if(sRow.URLType == "fullPage"){
						fullPage = GetContent(sde,sRow);
						var baseURLArray = sRow.URL.split("/");
						baseURL = baseURLArray[0] + "//" + baseURLArray[2] + "/";
						//fullPage = fullPage.replace(/<head>/, '<head><base href="' + baseURL + '">');
					}
				
				//Check if the global Use FullPage is set. TODO: Have to change this to use the Affiliate Specific options by setting this in the DE 
				if (isFatWire) {
					siteFurnitureHTML = fullPage;
				} else {
					siteFurnitureHTML = header + content3divStart + content3divEnd + footer;
				}

				siteFurnitureHTML = siteFurnitureHTML.replace(/<title>.*?<\/title>/g, '<title>Competition | ' + titleAffiliate + '</title>');
				siteFurnitureHTML = siteFurnitureHTML.replace("'/cs/social/js-built/'","'http://resources.news.com.au/cs/social/js-built/'");

				if(customCSSURL !== ""){
					siteFurnitureHTML = siteFurnitureHTML.replace("<head>", '<head><link rel="stylesheet" href="' + customCSSURL + '" />');
				}
				siteFurnitureHTML = siteFurnitureHTML.replace("<head>", '<head>' + mobilemeta);
				siteFurnitureHTML = siteFurnitureHTML.replace('<div id="section-header">','<div style="display:none;">');
				siteFurnitureHTML = siteFurnitureHTML.replace('<div id="content-2">','<div style="display:none;">');
				siteFurnitureHTML = siteFurnitureHTML.replace('<div id="content-3">','<div id="content-2">' + competitionHTML + '</div><div id="content-3">');
				if(affiliate === "The Herald Sun"){
					siteFurnitureHTML = siteFurnitureHTML.replace('<div id="footer">','<div id="content-4"></div><div id="footer">');
				}
				siteFurnitureHTML = siteFurnitureHTML.replace(/href=\"\//,'href="' + baseURL );
				Write(siteFurnitureHTML);
			}
			else {
				siteFurnitureHTML = HTTP.Get(siteFurnitureURL).Content;

				var baseURLArray = siteFurnitureURL.split("/");
				baseURL = baseURLArray[0] + "//" + baseURLArray[2] + "/";
				siteFurnitureHTML = siteFurnitureHTML.replace("<head>", '<head>' + mobilemeta);
				if(customCSSURL !== ""){
					siteFurnitureHTML = siteFurnitureHTML.replace("<head>", '<head><link rel="stylesheet" href="' + customCSSURL + '" />');
				}
				siteFurnitureHTML = siteFurnitureHTML.replace('<div id="content-3">','<div id="content-2">' + competitionHTML + '</div><div id="content-3">');
				siteFurnitureHTML = siteFurnitureHTML.replace(/href=\"\//,'href="' + baseURL );
				Write(siteFurnitureHTML);
			}
		}
		else {
			competitionHTML = competitionHTML.replace("<head>", '<head>' + mobilemeta );
			competitionHTML = competitionHTML.replace('<title>', '<title>Competition | ' + titleAffiliate);
			Write(competitionHTML);
		}
	}
}

  ListID: 137
  Index: 2


ExactTarget.OMM.FunctionExecutionException:  An error occurred when attempting to evaluate a HTTPGet function call.  See inner exception for details.
  ClientID: 1053686
  JobID: 0
  ListID: 0
  BatchID: 0
  SubscriberID: 0
  URL: http://www.dailytelegraph.com.au/news/whitelabels/e-services-whitelabel
Source:  Jint