C#–using System;
using System.Net;
using System.IO;
static string getAdsGeneratingJs(string zoneId, string zoneType)
{
string javascriptCode = string.Empty;
string url = $”
https://youradexchange.com/ad/s2sadblock.php?zone_id={zoneId}&zone_type={zoneType}&v=2″;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.AutomaticDecompression = DecompressionMethods.GZip;
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (Stream stream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(stream))
{
javascriptCode = reader.ReadToEnd();
}
// js to render in your html page
return javascriptCode;
}
string js = getAdsGeneratingJs(“rlpq9vlk7a”, “atag”);