Esempio n. 1
0
//
//
//
//	AdFonic specific implementation
//
//
//
bool CzAds::RequestAdAdFonic()
{
	// Get device surface dimensions
	Width = PLATFORM_DISPLAY->getCurrentWidth();
	Height = PLATFORM_DISPLAY->getCurrentHeight();

	CzString urlencoded;

	RequestURI = "http://adfonic.net/ad/";
	RequestURI += ApplicationID;
	RequestURI += "?";
	RequestURI += "r.id=";
	urlencoded.URLEncode(CzString(UDID).c_str());
	RequestURI += urlencoded;
	RequestURI += "&s.test=0";
	RequestURI += "&t.format=xml";
	if (!ExtraInfo.isEmpty())
	{
		RequestURI += ExtraInfo;
	}

	AdRequest.setGET();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.setBody("");
	CZ_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(CZ_ADS_TIMEOUT);

	return true;
}
Esempio n. 2
0
//
//
//
//	VServ specific implementation
//
//
//
bool CzAds::RequestAdVServ()
{
	// Get device surface dimensions
	Width = PLATFORM_DISPLAY->getCurrentWidth();
	Height = PLATFORM_DISPLAY->getCurrentHeight();

	// Build M2M request URI string
	RequestURI = "http://a.vserv.mobi/delivery/adapi.php?";
	CzString urlencoded;

	RequestURI += "zoneid=";
	RequestURI += ApplicationID;
	RequestURI += "&im=";
	RequestURI += CzString(UDID);
	RequestURI += "&lc=";
	RequestURI += PLATFORM_SYS->getDeviceLocale();
	RequestURI += "&app=1";
	RequestURI += "&ts=1";
	RequestURI += "&ua=";
	urlencoded.URLEncode(UserAgent.c_str());
	RequestURI += urlencoded;
	if (Width != 0)
	{
		RequestURI += "&sw=";
		RequestURI += CzString(Width);
	}
	if (Height != 0)
	{
		RequestURI += "&sh=";
		RequestURI += CzString(Height);
	}
	if (!ExtraInfo.isEmpty())
	{
		RequestURI += ExtraInfo;
	}

	AdRequest.setGET();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Accept", "application/xml");
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", "0");
	AdRequest.setBody("");
	CZ_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(CZ_ADS_TIMEOUT);

	return true;
}
Esempio n. 3
0
//
//
//
//	MillennialMedia specific implementation
//
//
//
bool CzAds::RequestAdMillennialMedia()
{
	// Build M2M request URI string
	RequestURI = "http://ads.mp.mydas.mobi/getAd.php5?";
	CzString urlencoded;

	RequestURI += "apid=";
	RequestURI += ApplicationID;
	RequestURI += "&auid=";
	RequestURI += CzString(UDID);
	RequestURI += "&ua=";
	urlencoded.URLEncode(UserAgent.c_str());
	RequestURI += urlencoded;
//	RequestURI += "&mode=test";
//	RequestURI += "&uip=";
//	RequestURI += CZ_HTTP_MANAGER->getIPAddress();

	if (UserAge != 0)
	{
		RequestURI += "&age=";
		RequestURI += CzString(UserAge);
	}
	if (UserGender != GenderInvalid)
	{
		if (UserGender == GenderFemale)
			RequestURI += "&gender=female";
		else
			RequestURI += "&gender=male";
	}
	if (!ExtraInfo.isEmpty())
	{
		RequestURI += ExtraInfo;
	}

	AdRequest.setGET();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Accept", "application/xml");
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", "0");
	AdRequest.setBody("");
	CZ_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(CZ_ADS_TIMEOUT);

	return true;
}
Esempio n. 4
0
//
//
//
//	KomliMobile specific implementation
//
//
//
bool CzAds::RequestAdKomliMobile()
{
	// Get device surface dimensions
	Width = PLATFORM_DISPLAY->getCurrentWidth();
	Height = PLATFORM_DISPLAY->getCurrentHeight();

	// Build M2M request URI string
	RequestURI = "http://a.zestadz.com/waphandler/deliverad?";
	CzString urlencoded;

	RequestURI += "ip=";
	RequestURI += CZ_HTTP_MANAGER->getIPAddress();
	RequestURI += "&cid=";
	RequestURI += ApplicationID;
	RequestURI += "&ua=";
	urlencoded.URLEncode(UserAgent.c_str());
	RequestURI += urlencoded;
	RequestURI += "&response_type=xml";
//	RequestURI += CzString(UDID);
	if (!ExtraInfo.isEmpty())
	{
		RequestURI += ExtraInfo;
	}

	AdRequest.setGET();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Accept", "application/xml");
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", "0");
	AdRequest.setBody("");
	CZ_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(CZ_ADS_TIMEOUT);

	return true;
}
Esempio n. 5
0
//
//
//
//	MobFox specific implementation
//
//
//
bool CzAds::RequestAdMobFox()
{
	// Build request URI string
	RequestURI = "http://my.mobfox.com/request.php";

	CzString body;
	CzString urlencoded;

	body = "rt=api";
	body += "&u=";
	urlencoded.URLEncode(UserAgent.c_str());
	body += urlencoded;
	body += "&i=";
	body += CZ_HTTP_MANAGER->getIPAddress();
	body += "&o=";
	body += CzString(UDID);
	body += "&m=live";
	body += "&s=";
	body += ApplicationID;
	if (!ExtraInfo.isEmpty())
	{
		body += ExtraInfo;
	}

	AdRequest.setPOST();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", CzString(body.getLength()).c_str());
	AdRequest.setBody(body.c_str());
	CZ_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(CZ_ADS_TIMEOUT);

	return true;
}
Esempio n. 6
0
//
//
//
//	AdModa specific implementation
//
//
//
bool CzAds::RequestAdAdModa()
{
	// Get device surface dimensions
	Width = PLATFORM_DISPLAY->getCurrentWidth();
	Height = PLATFORM_DISPLAY->getCurrentHeight();

	// Build M2M request URI string
	RequestURI = "http://www.admoda.com/ads/fetch.php?";
	CzString urlencoded;

	RequestURI += "v=4";
	RequestURI += "&l=php";
	RequestURI += "&z=";
	RequestURI += ApplicationID;
//	RequestURI += "&a=";
//	RequestURI += CZ_HTTP_MANAGER->getIPAddress();
	RequestURI += "&ua=";
	urlencoded.URLEncode(UserAgent.c_str());
	RequestURI += urlencoded;
	if (!ExtraInfo.isEmpty())
	{
		RequestURI += ExtraInfo;
	}

	AdRequest.setGET();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", "0");
	AdRequest.setBody("");
	CZ_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(CZ_ADS_TIMEOUT);

	return true;
}
Esempio n. 7
0
//
//
//
//	ImMobi specific implementation
//
//
//
bool CzAds::RequestAdInMobi()
{
	// Build M2M request URI string
	RequestURI = "http://w.inmobi.com/showad.asm";				// Live
//	RequestURI = "http://i.w.sandbox.inmobi.com/showad.asm";	// Test

	CzString body;
	CzString urlencoded;

	body = "mk-siteid=";
	body += ApplicationID;
	body += "&mk-carrier=";
	body += CZ_HTTP_MANAGER->getIPAddress();
	body += "&h-user-agent=";
	urlencoded.URLEncode(UserAgent.c_str());
	urlencoded.ToLower();
	body += urlencoded;
	body += "&u-id=";
	body += CzString(UDID);
	body += "&d-localization=";
	urlencoded.URLEncode(PLATFORM_SYS->getDeviceLocale());
	urlencoded.ToLower();
	body += urlencoded;
//	body += "&d-netType=wifi";
	body += "&d-netType=carrier";
	body += "&mk-version=pr-spec-atata-20090521";
	if (UserAge != 0)
	{
		body += "&u-age=";
		body += CzString(UserAge);
	}
	if (UserGender != GenderInvalid)
	{
		if (UserGender == GenderFemale)
			body += "&u-gender=f";
		else
			body += "&u-gender=m";
	}
	if (!UserGPSLocation.isEmpty())
	{
		body += "&u-latlong=";
		body += UserGPSLocation;
	}
	if (!UserKeywords.isEmpty())
	{
		body += "&u-interests=";
		body += UserKeywords;
	}
	if (!ExtraInfo.isEmpty())
	{
		body += ExtraInfo;
	}
//	body.ToLower();

	AdRequest.setPOST();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("X-Mkhoj-SiteID", ApplicationID.c_str());
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", CzString(body.getLength()).c_str());
	AdRequest.setBody(body.c_str());
	CZ_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(CZ_ADS_TIMEOUT);

	return true;
}
Esempio n. 8
0
//
//
//
//	Mojiva specific implementation
//
//
//
bool CzAds::RequestAdMojiva()
{
	// Build M2M request URI string
	RequestURI = "http://ads.mojiva.com/ad?";

	CzString urlencoded;

	RequestURI += "zone=";
	RequestURI += ApplicationID;
	RequestURI += "&ip=";
	RequestURI += CZ_HTTP_MANAGER->getIPAddress();
	urlencoded.URLEncode(UserAgent.c_str());
	RequestURI += urlencoded;
	RequestURI += "&udid=";
	RequestURI += CzString(UDID);

	if (!ExtraInfo.isEmpty())
	{
		RequestURI += ExtraInfo;
	}

/*	CzString local = s3eDeviceGetString(S3E_DEVICE_LOCALE);
	int pos = local.Contains('_');
	if (pos >= 0)
	{
		// Strip language and underscore
		local.setString(local.c_str() + pos + 1, 2);
		local.ToUpper();
		body += "&country=";
		body += local;
	}*/

/*	if (UserAge != 0)
	{
		body += "&age=";
		body += CzString(UserAge);
	}
	if (UserGender != GenderInvalid)
	{
		if (UserGender == GenderFemale)
			body += "&gender=F";
		else
			body += "&gender=M";
	}
	if (!UserKeywords.isEmpty())
	{
		body += "&keywords=";
		body += UserKeywords;
	}*/

	AdRequest.setGET();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", "0");
	AdRequest.setBody("");
	CZ_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(CZ_ADS_TIMEOUT);

	return true;
}
Esempio n. 9
0
bool CzAds::RequestAdMadvertise()
{
	// Build M2M request URI string
	RequestURI = "http://ad.madvertise.de/site/";
	RequestURI += ApplicationID;

	CzString body;
	CzString urlencoded;

	body += "ua=";
	urlencoded.URLEncode(UserAgent.c_str());
	body += urlencoded;
//	body += "&ip=";
//	body += CZ_HTTP_MANAGER->getIPAddress();
	body += "&requester=madvertise_api";
	body += "&version=api_2.1";
	body += "&unique_device_id=";
	body += CzString(UDID);
	if (!ExtraInfo.isEmpty())
	{
		body += ExtraInfo;
	}
/*	CzString local = PLATFORM_SYS->getDeviceLocale();
	int pos = local.Contains('_');
	if (pos >= 0)
	{
		// Strip language and underscore
		local.setString(local.c_str() + pos + 1, 2);
		local.ToUpper();
		body += "&country=";
		body += local;
	}*/

	if (UserAge != 0)
	{
		body += "&age=";
		body += CzString(UserAge);
	}
	if (UserGender != GenderInvalid)
	{
		if (UserGender == GenderFemale)
			body += "&gender=F";
		else
			body += "&gender=M";
	}
	if (!UserKeywords.isEmpty())
	{
		body += "&keywords=";
		body += UserKeywords;
	}

	AdRequest.setPOST();
	AdRequest.setURI(RequestURI.c_str());
	AdRequest.setContentAvailableCallback(&AdInfoRetrievedCallback, NULL);
	AdRequest.SetHeader("User-Agent", UserAgent.c_str());
	AdRequest.SetHeader("Accept", "application/xml");
	AdRequest.SetHeader("Content-Type", "application/x-www-form-urlencoded");
	AdRequest.SetHeader("Content-Length", CzString(body.getLength()).c_str());
	AdRequest.setBody(body.c_str());
	CZ_HTTP_MANAGER->AddRequest(&AdRequest);
	BusyTimer.setDuration(CZ_ADS_TIMEOUT);

	return true;
}