<?php
############################
# RapidShare search shit#
############################
# by Robin Houtevelts #
# robin@houtevelts.com #
############################
function http($url,$post = false){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if(!empty($post)){
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
$return = curl_exec($ch);
if($output === false)
$return = 'ERROR: '.curl_error($ch);
curl_close($ch);
return trim($return);
}
$username = 'username';
$password = 'password';
$title = trim($_GET['title']);
$apidata = array(
'sub' => 'listfiles',
'filename' => $title,
'fields' => 'filename',
'login' => $username,
'password' => $password
);
$apireturn = http('https://api.rapidshare.com/cgi-bin/rsapi.cgi',$apidata);
if(strpos($apireturn,'ERROR') === TRUE){
echo $apireturn;
exit;
}
if($apireturn == 'NONE'){
echo 'File not found';
exit;
}
$files = explode("\n",$apireturn);
$urls = array();
foreach($files as $file){
$file = explode(',',$file);
list($fileID,$filename) = $file;
$urls[] = 'https://rapidshare.com/files/'.$fileID.'/'.$filename;
}
$urls = implode("\n",$urls);
echo $urls;
?>
<?php
############################
# RapidShare search shit#
############################
# by Robin Houtevelts #
# robin@houtevelts.com #
############################
function http($url,$post = false){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if(!empty($post)){
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
$return = curl_exec($ch);
if($output === false)
$return = 'ERROR: '.curl_error($ch);
curl_close($ch);
return trim($return);
}
$username = 'username';
$password = 'password';
?>
<html>
<head></head>
<body>
<?php
if(empty($_GET['title'])){
?>
<form action="" method="GET">
<input type="text" name="title" />
<input type="submit" value="Search" />
</form>
<?php
}else{
$title = '%'.trim($_GET['title']).'%';
$apidata = array(
'sub' => 'listfiles',
'filename' => $title,
'fields' => 'filename',
'login' => $username,
'password' => $password
);
$apireturn = http('https://api.rapidshare.com/cgi-bin/rsapi.cgi',$apidata);
if(strpos($apireturn,'ERROR') === TRUE){
echo $apireturn;
exit;
}
if($apireturn == 'NONE'){
echo 'File not found';
exit;
}
$files = explode("\n",$apireturn);
$urls = array();
foreach($files as $file){
$file = explode(',',$file);
list($fileID,$filename) = $file;
$urls[] = 'https://rapidshare.com/files/'.$fileID.'/'.$filename;
}
$urls = implode("\n",$urls);
?>
<textarea><?php echo $urls;?></textarea>
<?php
}
?>
</body>
</html>