Friday, July 8, 2011

<% Dim searchKeywords searchKeywords=""

Function pantherads_comScreenRes()
Dim screenRes, delimiter, resArray
screenRes = Request.ServerVariables("HTTP_UA_PIXELS")
delimiter = "x"
If IsEmpty(screenRes) Then
screenRes = Request.ServerVariables("HTTP_X_UP_DEVCAP_SCREENPIXELS")
delimiter = ","
End If
If IsEmpty(screenRes) Then
screenRes = Request.ServerVariables("HTTP_X_JPHONE_DISPLAY")
delimiter = "*"
End If
resArray = Split(screenRes, delimiter, 2)
If (UBound(resArray) + 1) = 2 Then
pantherads_comScreenRes = "&u_w=" & resArray(0) & "&u_h=" & resArray(1)
End If
End Function

Function pantherads_comMuid()
Dim muid
muid = Request.ServerVariables("HTTP_X_DCMGUID")
If Not IsEmpty(muid) Then
pantherads_comMuid = "&muid=" & muid
End If
muid = Request.ServerVariables("HTTP_X_UP_SUBNO")
If Not IsEmpty(muid) Then
pantherads_comMuid = "&muid=" & muid
End If
muid = Request.ServerVariables("HTTP_X_JPHONE_UID")
If Not IsEmpty(muid) Then
pantherads_comMuid = "&muid=" & muid
End If
muid = Request.ServerVariables("HTTP_X_EM_UID")
If Not IsEmpty(muid) Then
pantherads_comMuid = "&muid=" & muid
End If
End Function

Function pantherads_comViaAndAccept(pantherads_comUserAgent)
If Len(pantherads_comUserAgent) = 0 Then
Dim via
via = Server.URLEncode(Request.ServerVariables("HTTP_VIA"))
If Not IsEmpty(via) Then
pantherads_comViaAndAccept = "&via=" & via
End If
Dim accept
accept = Server.URLEncode(Request.ServerVariables("HTTP_ACCEPT"))
If Not IsEmpty(accept) Then
pantherads_comViaAndAccept = pantherads_comViaAndAccept & "&accept=" & accept
End If
End If
End Function

Dim pantherads_comScheme,pantherads_comUserAgent
pantherads_comScheme = "http://"
pantherads_comUserAgent = Server.URLEncode(Request.ServerVariables("HTTP_USER_AGENT"))
If StrComp(Request.ServerVariables("HTTPS"), "on") = 0 Then pantherads_comScheme = "https://"

Dim pantherads_comUrl, pantherads_comOutput
pantherads_comUrl = "http://pantherads.com/wap-ads.php?" &_
"&pid=438" &_
"&id=1675" &_
"&search=" & Server.URLEncode(searchKeywords) &_
"&ip=" & Server.URLEncode(Request.ServerVariables("REMOTE_ADDR")) &_
"&ref=" & Server.URLEncode(Request.ServerVariables("HTTP_REFERER")) &_
"&url=" & Server.URLEncode(pantherads_comScheme & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("URL")) &_
"&useragent=" & pantherads_comUserAgent &_
pantherads_comScreenRes() &_
pantherads_comMuid() &_
pantherads_comViaAndAccept(pantherads_comUserAgent)

Set pantherads_comOutput = Server.CreateObject("MSXML2.ServerXMLHTTP")
pantherads_comOutput.Open "GET", pantherads_comUrl, false
pantherads_comOutput.Send
Response.Write(pantherads_comOutput.responseText)
%>
<%@ page import="java.io.BufferedReader, java.io.InputStreamReader, java.io.IOException, java.io.UnsupportedEncodingException, java.net.URL, java.net.URLEncoder, java.util.ArrayList, java.util.List" %>
<%! String searchKeywords = "";

private static final String ADPAGE = "http://pantherads.com/wap-ads.php?";

private void pantherads_comAppendUrl(StringBuilder url, String param, String value)
throws UnsupportedEncodingException {
if (value != null) {
String encodedValue = URLEncoder.encode(value, "utf-8");
url.append("&").append(param).append("=").append(encodedValue);
}
}

private void pantherads_comAppendScreenRes(StringBuilder url, String uaPixels,
String xUpDevcapScreenpixels, String xJphoneDisplay) {
String screenRes = uaPixels;
if (screenRes == null) {
screenRes = xUpDevcapScreenpixels;
}
if (screenRes == null) {
screenRes = xJphoneDisplay;
}
if (screenRes != null) {
String[] resArray = screenRes.split("[x,*]");
if (resArray.length == 2) {
url.append("&u_w=").append(resArray[0]);
url.append("&u_h=").append(resArray[1]);
}
}
}

private void pantherads_comAppendMuid(StringBuilder url, List muids) {
for (String muid : muids) {
if (muid != null) {
url.append("&muid=").append(muid);
}
}
}

private void pantherads_comAppendViaAndAccept(StringBuilder url, String via,
String accept) throws UnsupportedEncodingException {
pantherads_comAppendUrl(url, "via", via);
pantherads_comAppendUrl(url, "accept", accept);
}

StringBuilder pantherads_comUrlStr = new StringBuilder(ADPAGE);
%>
<% pantherads_comUrlStr.append("pid=438"); pantherads_comUrlStr.append("&id=1675"); pantherads_comUrlStr.append("&search="); pantherads_comUrlStr.append(URLEncoder.encode(searchKeywords, "utf-8")); pantherads_comAppendUrl(pantherads_comUrlStr, "ip", request.getRemoteAddr()); pantherads_comAppendUrl(pantherads_comUrlStr, "ref", request.getHeader("Referer")); String pantherads_comRequestUrl = request.getRequestURL().toString(); if (request.getQueryString() != null) { pantherads_comRequestUrl += "?" + request.getQueryString().toString(); } pantherads_comAppendUrl(pantherads_comUrlStr, "url", pantherads_comRequestUrl); String pantherads_comUserAgent = request.getHeader("User-Agent"); pantherads_comAppendUrl(pantherads_comUrlStr, "useragent", pantherads_comUserAgent); pantherads_comAppendScreenRes(pantherads_comUrlStr, request.getHeader("UA-pixels"), request.getHeader("x-up-devcap-screenpixels"), request.getHeader("x-jphone-display")); if (pantherads_comUserAgent == null || pantherads_comUserAgent.length() == 0) { pantherads_comAppendViaAndAccept(pantherads_comUrlStr, request.getHeader("Via"), request.getHeader("Accept")); } try { URL pantherads_comUrl = new URL(pantherads_comUrlStr.toString()); BufferedReader reader = new BufferedReader(new InputStreamReader(pantherads_comUrl.openStream(), "utf-8")); for (String line; (line = reader.readLine()) != null;) { out.println(line); } } catch (Throwable e) { out.println(e.toString()); } %>
$searchKeywords = "";

$GLOBALS['pantherads_com']['pid']='438';
$GLOBALS['pantherads_com']['id']='1675';
$GLOBALS['pantherads_com']['search']=urlencode($searchKeywords);
$GLOBALS['pantherads_com']['ip']=read_global('REMOTE_ADDR');
$GLOBALS['pantherads_com']['ref']=read_global('HTTP_REFERER');
$GLOBALS['pantherads_com']['url']=read_global('HTTP_HOST') . read_global('REQUEST_URI');
$GLOBALS['pantherads_com']['useragent']=read_global('HTTP_USER_AGENT');

pantherads_com_set_screen_res();
pantherads_com_set_via_and_accept();

function read_global($var) {
return isset($_SERVER[$var]) ? $_SERVER[$var]: '';
}

function pantherads_com_append_url(&$url, $param, $value) {
$url .= $param . '=' . urlencode($value).'&';
}

function pantherads_com_append_globals(&$url, $param) {
pantherads_com_append_url($url, $param, $GLOBALS['pantherads_com'][$param]);
}

function pantherads_com_set_screen_res() {
$screen_res = read_global('HTTP_UA_PIXELS');
if ($screen_res == '') {
$screen_res = read_global('HTTP_X_UP_DEVCAP_SCREENPIXELS');
}
if ($screen_res == '') {
$screen_res = read_global('HTTP_X_JPHONE_DISPLAY');
}
$res_array = split('[x,*]', $screen_res);
if (sizeof($res_array) == 2) {
$GLOBALS['pantherads_com']['u_w'] = $res_array[0];
$GLOBALS['pantherads_com']['u_h'] = $res_array[1];
}
}

function pantherads_com_set_muid() {
$muid = read_global('HTTP_X_DCMGUID');
if ($muid != '') {
$GLOBALS['pantherads_com']['muid'] = $muid;
}
$muid = read_global('HTTP_X_UP_SUBNO');
if ($muid != '') {
$GLOBALS['pantherads_com']['muid'] = $muid;
}
$muid = read_global('HTTP_X_JPHONE_UID');
if ($muid != '') {
$GLOBALS['pantherads_com']['muid'] = $muid;
}
$muid = read_global('HTTP_X_EM_UID');
if ($muid != '') {
$GLOBALS['pantherads_com']['muid'] = $muid;
}
}

function pantherads_com_set_via_and_accept() {
$ua = read_global('HTTP_USER_AGENT');
if ($ua == '') {
$GLOBALS['pantherads_com']['via'] = read_global('HTTP_VIA');
$GLOBALS['pantherads_com']['accept'] = read_global('HTTP_ACCEPT');
}
}

function pantherads_com_get_ad_url() {
$pantherads_com_ad_url = "http://pantherads.com/wap-ads.php?" ;
foreach ($GLOBALS['pantherads_com'] as $param => $value) {
if (strpos($param, 'url') === 0) {
$pantherads_com_scheme = (read_global('HTTPS') == 'on')
? 'https://' : 'http://';
pantherads_com_append_url($pantherads_com_ad_url, $param,
$pantherads_com_scheme . $GLOBALS['pantherads_com'][$param]);
} else {
pantherads_com_append_globals($pantherads_com_ad_url, $param);
}
}
$pantherads_com_ad_url=substr($pantherads_com_ad_url,0,-1);
return $pantherads_com_ad_url;
}

$pantherads_com_ad_handle = @fopen(pantherads_com_get_ad_url(), 'r');
if ($pantherads_com_ad_handle) {
while (!feof($pantherads_com_ad_handle)) {
echo fread($pantherads_com_ad_handle, 8192);
}
fclose($pantherads_com_ad_handle);
}

?>


Thursday, May 5, 2011

Monday, May 2, 2011