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
Code.
<?php
include(“phpHTMLParser.php”);
if (isset($_GET['url']) )
{
$postfields = $_GET['url'];
} else {
die(“No urls defined”);
}
$url = “http://rapidshare.com/cgi-bin/checkfiles.cgi”;
$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:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11′);
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
curl_close($ch);
//$data = parseHtml($result);
// var_dump($data);
//var_dump($result);
$files = ereg_replace(“http://rapidshare.com”,”",$postfields);
list($junk,$files,$folder,$filename) = split(“/”,$files);
//var_dump($data);
$result = strip_tags($result,”<font>”);
$parser = new phpHTMLParser(“$result”);
$HTMLObject = $parser->parse_tags(array(“font”));
$aTags = $HTMLObject->getTagsByName(“font”);
//var_dump($aTags);
//$HTMLObject->output();
/*
$parser = new HTML_Parser;
$output = $parser->parse($result);
var_dump($output);
?*/
$Found = false ;
foreach ($aTags as $a) {
if ( $a->innerTag == “color=\”green\”") {
if ( strstr($a->innerHTML,$folder) && strstr($a->innerHTML,$filename) )
{
$Found = true;
break;
}
}
}
if ( $Found == true )
{
echo “I found the file fucker!”;
} else {
echo ” its not there moron ” ;
}
//var_dump($a);
?>
Play around ! and you can write your bot using it.
~ by azimyasin on January 20, 2008.
Posted in APACHE MYSQL PHP, php
Tags: php link checker, php rapidshare link, php rs linkchecker, rs linkchecker in php




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?
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
Regards
Azeem.
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:
urls=”"
for i in `grep -o -i “http.*rapidshare.com.*” “$url” | sed -e ’s/<.*\|\”.*//’ -e ’s/:/:/’ -e ’s/ .*$//’`
do
urls=”$urls$i%0D%0A”
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?
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.
No it can be used to work for multiple urls i suppose!
must i save the file in .php or html and how can i make online
Can You Prapered Script Please
I dont understand this Code’s