Skip to content

Instantly share code, notes, and snippets.

@frank-dspeed
Created September 25, 2015 08:58
Show Gist options
  • Save frank-dspeed/8be0bead16b8edc043cf to your computer and use it in GitHub Desktop.
Save frank-dspeed/8be0bead16b8edc043cf to your computer and use it in GitHub Desktop.
#!/usr/bin/php
<?php
parse_str(implode('&', array_slice($argv, 1)), $_GET);
if (strpos($argv[1],'adspace') !== false) {
print slimParseAdUrl($argv[1]);
print "\n";
} else {
print slimParseAdUrl($argv[1], true);
print "\n";
}
# print_r ($argv);
# print "\n";
# print slimParseAdUrl("$_GET[0]", true);
function slimParseAdUrl($strlUrl, $isDirect = false)
{
$strProxyHost = "http://proxy.z-defense.com:81/";
$strPingBackHost = "http://pingback.z-defense.com:81/p/?u=";
if($isDirect)
{
return str_replace("http://spaces.slimspots.com/", $strProxyHost, $strlUrl);
}
return $strPingBackHost.base64_encode($strlUrl);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment