<?php
$cache_time = 10000; // cache time in seconds
$cache_folder = 'cactey27632801jkashsay'; //put random letters and numbers, maybe you'll need to chmod this folder on 777... Be sure that this folder exist on your server
$cache_filename = $cache_folder.'/'.md5($_SERVER['REQUEST_URI']);
if (file_exists($cache_filename)) $cache_created = filemtime($cache_filename);
else $cache_created = 0;
if ((time() - $cache_created) < $cache_time) {
readfile($cache_filename);
die();
}
ob_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="author" content="www.wapx.ws">
<style type="text/css">
body {
font-family: Verdana;
font-size: 12px;
margin: auto;
text-align: center;
max-width:500px;
color: blue;
background-color: #CFE8F3;
font-style: oblique; }
a {
text-decoration: none;
}
a:hover {
font-size: 14px;
}
a:visited {
color: blue;
}
div.header {
width: 100%;
border-top: 2px solid #FFFFFF;
border-bottom: 2px solid #FFFFFF;
border-left: 2px solid #FFFFFF;
border-right: 2px solid #FFFFFF;
background-color: #2F91BB;
color: #FFFFFF;
}
div.body {
width: 100%;
border-left: 2px solid #FFFFFF;
border-right: 2px solid #FFFFFF;
background-color: #7DC1DF;
color: blue;
}
div.footer {
width: 100%;
border-top: 2px solid #FFFFFF;
border-bottom: 2px solid #FFFFFF;
border-left: 2px solid #FFFFFF;
border-right: 2px solid #FFFFFF;
background-color: #2F91BB;
color: #FFFFFF;
}
</style>
<title>Wapx Grabber</title>
</head>
<body>
<div class="header">Free java games</div>
<div class="body">
<?php
$a = $_GET['a'];
$n = $_GET['n'];
$a = str_replace('/', '', $a);
if (!empty($n)) {
$name = str_replace('-', ' ', $n);
$name = str_replace('/', ' ', $name);
$process = curl_init('http://wapx.ws/games/'.$n);
curl_setopt($process, CURLOPT_USERAGENT, 'WapX Grabber');
curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
$return = curl_exec($process);
curl_close($process);
$print = explode('<div class="tags_div">', $return);
$echo = explode('<form', $print[1]);
$echo1 = explode('</div>', $print[2]);
$echo1[0] = str_replace('(', '', $echo1[0]);
$echo1[0] = str_replace('JAD', '', $echo1[0]);
$echo1[0] = str_replace(',', '', $echo1[0]);
$echo1[0] = str_replace('ZIP', '', $echo1[0]);
$echo1[0] = str_replace(')', '', $echo1[0]);
$echo1[0] = str_replace('http://wapx.ws/games/download.php', 'http://wapx.ws/games/dow.php', $echo1[0]);
echo '<br><strong>'.$name.'</strong><br><br>'.$echo[0].'<br><br>'.$echo1[0].'<br><a href="index.php">« back</a><br>';
}
else {
$process = curl_init('http://wapx.ws/games/index.php?page='.$a);
curl_setopt($process, CURLOPT_USERAGENT, 'WapX Grabber');
curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);
$return = curl_exec($process);
curl_close($process);
$print = explode('</form>', $return);
$echo = explode('</a>|<br>', $print[1]);
$echo[0] = $echo[0].'</a>';
$echo[0] = str_replace('http://wapx.ws/games/sort/page/', 'index.php?a=', $echo[0]);
$echo[0] = str_replace('http://wapx.ws/games/', 'index.php?n=', $echo[0]);
$echo[0] = str_replace('|', ' ', $echo[0]);
$echo[0] = str_replace('</a><br><a', '</a><br><br><a', $echo[0]);
echo $echo[0].'<br><br>';
}
?>
</div>
<div class="footer">All Rights Reserved<br>2011</div>
</body>
</html>
<?php
file_put_contents($cache_filename, ob_get_contents());
ob_end_flush();
?>