كود PHP:
<?php
class Rapidshare
{
var $upURL;
function getUpURL()
{
$rs = file_get_contents("http://rapidshare.com");
$rs = explode("action=\"", $rs);
$rs = explode("\"", $rs[1]);
$this->upURL = $rs[0];
}
function getDownloadLink($ret) {
$ret = explode("Download Link:</td><td align=right><a href=\"", $ret);
$ret = explode("\"", $ret[1]);
return $ret[0];
}
function upload()
{
global $upfile, $file_temporary_location;
$postdata = array();
$postdata['filecontent'] = "@" . getcwd() . "/" . $file_temporary_location;
$this->getUpURL();
$curl = curl_init($this->upURL);
curl_setopt($curl, CURLOPT_URL, $this->upURL);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
$page = curl_exec($curl);
curl_close($curl);
$dlLink = $this->getDownloadLink($page);
return strtolower($dlLink);
}
}
class Filefactory
{
var $upURL;
function getUpURL()
{
$ff = file_get_contents("http://filefactory.com");
$ff = explode("<form id=\"uploader\" action=\"", $ff);
$ff = explode("\"", $ff[1]);
$this->upURL = $ff[0];
}
function getDownloadLink($id)
{
global $basefilename;
return "http://www.filefactory.com/file/" . $id . "/n/" . $basefilename;
}
function upload()
{
global $upfile, $file_temporary_location;
$postdata = array();
$postdata['file'] = "@" . getcwd() . "/" . $file_temporary_location;
$this->getUpURL();
$curl = curl_init($this->upURL);
curl_setopt($curl, CURLOPT_URL, $this->upURL);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
$page = curl_exec($curl);
curl_close($curl);
$dlLink = $this->getDownloadLink($page);
return strtolower($dlLink);
}
}
class Megashare
{
function getDownloadLink($page) {
$page = explode("SIZE=\"50\" readonly=\"0\" VALUE=\"", $page);
$page = explode("\"", $page[1]);
return $page[0];
}
function upload()
{
global $upfile, $file_temporary_location;
$postdata = array();
$postdata['upfile_0'] = "@" . getcwd() . "/" . $file_temporary_location;
$postdata['fps'] = "";
$postdata['upload_range'] = "1";
$postdata['emai'] = "Free";
$urlUp = "http://upload.megashare.com/cgi-bin/uploader.cgi?tmp_sid=".session_name()."&rnd=1";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $urlUp);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
$page = curl_exec($curl);
curl_close($curl);
$dlLink = $this->getDownloadLink($page);
return strtolower($dlLink);
}
}
class MegaUpload{
var $upID;
var $upURL;
var $SID;
function getUpURL() {
$page = file_get_contents("http://megaupload.com");
$bup = $page;
$page = explode("ENCTYPE=\"multipart/form-data\" action=\"", $page);
$page = explode("\"", $page[1]);
$this->upURL = $page[0];
$page = explode("?UPLOAD_IDENTIFIER=", $page[0]);
$this->upID = $page[1];
$bup = explode("name=\"sessionid\" value=\"", $bup);
$bup = explode("\"", $bup[1]);
$this->SID = $bup[0];
}
function getDownloadLink($page) {
$page = explode("parent.downloadurl = '", $page);
$page = explode("'", $page[1]);
return strToLower($page[0]);
}
function upload() {
global $file_temporary_location;
$this->getUpURL();
$postdata = array();
$postdata['filecount'] = "";
$postdata['UPLOAD_INDENTIFIER'] = $this->upID;
$postdata['sessionid'] = $this->SID;
$postdata['file'] = "@" . getcwd() . "/" . $file_temporary_location;
$postdata['message'] = "File upload";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $this->upURL);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
$page = curl_exec($curl);
curl_close($curl);
return $this->getDownloadLink($page);
}
}
class loadto{
var $upURL;
function getUpURL() {
$page = file_get_contents("http://load.to");
$action = explode("<form name=\"form_upload\" method=\"post\" enctype=\"multipart/form-data\" action=\"", $page);
$action = explode("\"", $action[1]);
$this->upURL = $action[0];
}
function getDownloadLink($page) {
$page = explode("<td align=\"left\"><a href=\"", $page);
$page = explode("\"", $page[1]);
return $page[0];
}
function upload() {
global $file_temporary_location;
$this->getUpURL();
$postdata = array();
$postdata['imbedded_progress_bar'] = "0";
$postdata['upload_range'] = "1";
$postdata['upfile_0'] = "@" . getcwd() . "/" . $file_temporary_location;
$postdata['submit'] = "Upload";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $this->upURL);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
$page = curl_exec($curl);
curl_close($curl);
return $this->getDownloadLink($page);
}
}
class justupit{
function getDownloadLink($page) {
$page = explode("value=\"", $page);
$page = explode("\"", $page[1]);
return $page[0];
}
function upload() {
global $file_temporary_location;
$postdata = array();
$postdata['filecontent'] = "@" . getcwd() . "/" . $file_temporary_location;
$postdata['MAX_FILE_SIZE'] = "50000";
$postdata['frontpage'] = "yes";
$postdata['u'] = "Upload File Now";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "http://www.justupit.com/upload.php");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
$page = curl_exec($curl);
curl_close($curl);
return $this->getDownloadLink($page);
}
}
function setLinksBox($text) {
echo "<script>parent.document.getElementById('links').innerHTML = ' $text '; </script>";
}
$upload = new upload;
$Rapidshare = new Rapidshare;
$Filefactory = new Filefactory;
$Megashare = new Megashare;
$MegaUpload = new MegaUpload;
$loadto = new loadto;
$justupit = new justupit;
?>
بس للاسف حاولت بكل الطرق انى اضيف مركز بنفس الطريقة اللى منفذها عن طريق اخذ المعلومات من سورس صفحة المركز وفشلت