Location: PHPKode > projects > rapidshareBot > rapidsharebot/download.php
<?php
include('functions.inc.php');

//echo $_GET['title'];
$filestube_url = $_GET['fid']; 
$content_url = base64_decode( urldecode($_GET['cid']) );

if( $_SERVER['SERVER_NAME'] == 'localhost.com'){
$content_url = 'http://mbit.tk/lab/download-script/html/sample.html.html';
}
//readibility content url, cache it if not found.

$cache = new JG_Cache('./store');
$key = $content_url;
$content_data = $cache->get($key);
if ($content_data === FALSE)
   {
$html = fetch_url($content_url, 'http://google.com/');
if($html){ 
$readability = new Readability($html, $content_url);

$readability->debug = false;
$readability->convertLinksToFootnotes = false;
$result = $readability->init();
if ($result) {
	
	$title = $readability->getTitle()->textContent;
	
	$content = $readability->getContent()->innerHTML;
	// if we've got Tidy, let's clean it up for output
	if (function_exists('tidy_parse_string')) {
		$tidy = tidy_parse_string($content, array('indent'=>true, 'show-body-only' => true), 'UTF8');
		$tidy->cleanRepair();
		$content = $tidy->value;
	}
		
	$parts = parse_url($content_url);
    $base_url = $parts['scheme']. '://' . $parts['host'];
	
	$content = str_get_html($content);
	$imgs = $content ->find('img');
	if($imgs){
	  foreach ($imgs as $img) {
	    $img->src = makeabsolute($base_url, $img->src);
	    }
	}
    $content = preg_replace('!</?a[^>]*>!', '', $content);
    //$content = strip_tags($content, '<img>');
	
} else {
	$content = ''; //Looks like we couldn\'t find the description of the file. :(';
}
$content_data = array('title' => $title, 'content' => $content);
$cache->set($key, serialize( $content_data ));
}
else{
  $title = $_GET['title'];
  $content = "Download now.";
  }
 
}else{
 $content_data = unserialize( $content_data );
 $title = $content_data['title'];
 $content = $content_data['content'];
 }
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title><?php echo 'Download ' . $title . ' ' . $site_name; ?></title>
<link href="style.css" rel="stylesheet">
<meta name="robots" content="all" />
<meta name="description" content="<?php $tmp = str_split(str_replace("\n", "", strip_tags($content)), 150); echo $tmp[0]; ?>">
<meta name="keywords" content="<?php echo $title; ?>">
<meta property="og:title" content="<?php echo $_SERVER['SERVER_NAME']; ?>">
<meta property="og:site_name" content="<?php echo $_SERVER['SERVER_NAME']; ?>">
<link rel="shortcut icon" href="favicon.ico">
<link href="feed.php" rel="alternate" type="application/rss+xml" title="Free Downloads - <?php echo $_SERVER['SERVER_NAME']; ?>" />
<script>
function form_validate(formName){
    if( (eval("document."+formName+".q.value") == ""))
    {
        alert("Please enter the some search term/s.");
        return false;
    }
  }
</script>
</head>
<body>
<A href="http://freephpwebscripts.appspot.com/rapidsharebot.html" class='t' style="float:right;color:red;" title="Make money hosting your own download site for free." target="_blank"><blink>Make money.</blink></A>
<br/><center><a href="./"><img src="img/logo.jpg" border="0" alt="free full version downloads <?php echo $_SERVER['SERVER_NAME']; ?>"></a></center>

<h1 id="logo" style="text-align: center">
	<h1 style="display:none;"><?php echo $title; ?></h1>
</h1>
<table class="lnav" cellpadding="5" cellspacing="0">
<tbody><tr>
<td></a></td>
<td>
<form name="search" id="search" action="search.php" method="get" onsubmit="return form_validate('search');">
<table cellpadding="3" cellspacing="0">
<tbody><tr>
<td>&nbsp;&nbsp;<input name="q" class="input_text" size="26" maxlength="512" value="" style="height:30px;width:500px;font-size:23px"></td>
<td><input id="fj" class="input_submit" value="   Search   " type="submit" style="color:#1558AF;font-size:20px;height:35;width:130;"></td>
<td><!--<a href="/advanced_search?q={{ query }}&amp;l={{ where }}">Advanced Search</a>--></td>
</tr>
<tr valign="top">
<td class="label">&nbsp;&nbsp;&nbsp;&nbsp;<b>What:</b> Your Search Terms.</td>
</tr>
</tbody></table>
</form>
</td>
</tr>
</tbody></table>


<h1 style="display:none;"><?php echo $title; ?></h1>
<?php 
if (strlen($title) > 50){
$title = str_split ($title, 50);
$title = $title[0] . '...';
}
?>
<h1><?php echo 'Download ' . $title; ?></h1>
<?php echo '<center>' . $content_top_ad . '</center><br/>'; ?>
<div style="background: #f3f3f3;padding: 10px;">

<?php echo $content; ?> 
<center><a href="downloadgo.php?id=<?php echo $filestube_url; ?>" id="dl" title="free full version downloads"><img src="img/download-button.png" alt="Download now."/></a></center>
<br/><br/><br/>
</div><br/><br/>
Recent uploaded files:
<div id="recent" style="margin:0 auto 0;padding:10px;text-align:center;border-top:1px solid #c9d7f1;border-bottom:1px solid #c9d7f1;background: #f3f3f3;padding: 10px;"> 
<?php 
$trends = build_trends(date("Y-m-d"));
shuffle($trends);
foreach ($trends as $trend) {

echo '<a href="search.php?q=' . urlencode($trend) .'" class="rec"  title="' . $trend .' free full version downloads">' . $trend .'</a>&nbsp;&nbsp;&nbsp;&nbsp;'; 
}
?>
 <a href="recent.php?id=US" title="Recent files">More Recent files</a>
 <a href="trends.php" title="Previous day's trends">Trendings files</a><br class="clear" />
 </div></center>

<br class="clear" /></div>
<br/><br/>
<h1>Copyright</h1>
<p>Every file is copyrighted to their respected owners. We do not hold any.</p>
<BR>
<h1></h1>
<?php include "footer.html"; ?>
<BR>
<?php echo $analytics_code; ?>
<!-- ping it by user visit via iframe or crawler via link -->
<div id="ping_div" style="display:none;">
<?php 
$ping_url = rtrim('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); 
echo "<a href=\"$ping_url\">Free download</a>";
$feed_url = rtrim('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'], 'download.php') . 'feed.php';
$pingomatic_url = "http://pingomatic.com/ping/?title=" . urlencode($site_name) . "&blogurl=" . $ping_url . "&rssurl=" . $feed_url . "&chk_weblogscom=on&chk_blogs=on&chk_technorati=on&chk_feedburner=on&chk_syndic8=on&chk_newsgator=on&chk_feedster=on&chk_myyahoo=on&chk_pubsubcom=on&chk_blogdigger=on&chk_blogrolling=on&chk_blogstreet=on&chk_moreover=on&chk_weblogalot=on&chk_icerocket=on&chk_audioweblogs=on&chk_rubhub=on&chk_geourl=on&chk_a2b=on&chk_blogshares=on";
echo "<iframe src=\"$pingomatic_url\" height=\"0\" width=\"0\"></iframe>";
?>
</div>
</body>
</html>

Return current item: rapidshareBot