Writing a Rapidshare Linkchecker in php!

Maxgrab.org the porject that started as “just for fun” for me is grooming like hell! with me not working at all and other admins like kissme1 St0L3n buzzing me on msn daily to code forthem atleast some thing!

I have been only doing some Anti  DDoS stuff and nothing more over there

St0L3n asked me to write up a bot sorta stuff that would check RS links from the boards !
and here it’s!! using curl! and a html parser class available at here




if (isset($_GET[‘url’]) )


$postfields = $_GET[‘url’];

} else {

die(“No urls defined”);


$url = “http://rapidshare.com/cgi-bin/checkfiles.cgi&#8221;;

$ch = curl_init(); // initialize curl handle

curl_setopt($ch, CURLOPT_URL,$url); // set url to post to

curl_setopt($ch, CURLOPT_USERAGENT, ‘Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20071127 Firefox/’);

curl_setopt($ch, CURLOPT_FAILONERROR, 1);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable

curl_setopt($ch, CURLOPT_TIMEOUT, 10); // times out after 4s

curl_setopt($ch, CURLOPT_POST, 1); // set POST method

curl_setopt($ch, CURLOPT_POSTFIELDS, “urls=”.$postfields); // add POST fields

$result = curl_exec($ch); // run the whole process


//$data = parseHtml($result);

// var_dump($data);


$files = ereg_replace(“http://rapidshare.com&#8221;,””,$postfields);

list($junk,$files,$folder,$filename) = split(“/”,$files);


$result = strip_tags($result,”<font>”);

$parser = new phpHTMLParser(“$result”);

$HTMLObject = $parser->parse_tags(array(“font”));

$aTags = $HTMLObject->getTagsByName(“font”);




$parser = new HTML_Parser;

$output = $parser->parse($result);



$Found = false ;

foreach ($aTags as $a) {

if ( $a->innerTag == “color=\”green\””) {

if ( strstr($a->innerHTML,$folder) && strstr($a->innerHTML,$filename) )


$Found = true;
if ( $Found == true )
echo “I found the file fucker!”;
} else {
echo ” its not there moron ” ;


Play around ! and you can write your bot using it. 😉


~ by Azeem on January 20, 2008.

8 Responses to “Writing a Rapidshare Linkchecker in php!”

  1. I would like to integrate a link checker on my vBulletin forum.
    I mean; I set it in order to run the script every two days and it checks for dead links and add underneat an image that says “link isn’t still aviable” or something like that. So, it will check every post in order to find dead links.
    Can you help me?

  2. You can use the above code to integrate such thing on the forum.

    You would require to create a bot which would rom around you database and checks for links


  3. Hi, I wrote a script in bash that does something similiar.
    It takes a file /txt or html/ and gets rs urls from it, then it checks if they are valid. This is just a part of it:

    for i in `grep -o -i “http.*rapidshare.com.*” “$url” | sed -e ‘s/<.*\|\”.*//’ -e ‘s/:/:/’ -e ‘s/ .*$//’`
    done wget “http://rapidshare.com/cgi-bin/checkfiles.cgi?urls=$urls” -O – | grep -o “File.*” | sed ‘s/<.*//’

    I found out that if you feed it too many links (~100) it would spit an error because the header is too big. Anyway your script seems to check for a single file. Am I correct?

  4. i will use this also in my site i hope u make a universal code for it is mean:

    when clicked it checks randomly for 10 posts, these links are provided inside a page or something. or every now and then it crawls the database i dunno how to work it i would like an idea for that.

  5. No it can be used to work for multiple urls i suppose!

  6. must i save the file in .php or html and how can i make online

  7. Can You Prapered Script Please

    I dont understand this Code’s

  8. I’ve found a new WordPress Link Checker which works as this one no longer works. http://linkzbot.com/add-wordpress.php

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: