Rapidshare link check

Discussion in 'PHP' started by MasterOfDeath, Dec 10, 2009.

  1. #1
    Hiya mates,

    i have new project website and i need some snippets
    http://rapidlinks.ru/link/?lnk=146415 like in example checking rapidshare links showing status (dead or alive) and their size, if dead delete from database
    how can i do this with curl or rapidshare api?
    Any idea?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
     
    <body>
    <center>
    <form method="post" action="">
    Rapidshare Links:<br />
    <textarea name="url" rows="10" cols="50"></textarea><br /><br /><input type="submit" name="submit" value="Check Links"> | <input type="reset" value="Clear">
    </form>
     
    <?php
    if(isset($_REQUEST['submit'])){
    echo "<br />-------------------------------------------------<br />";
    $url = @$_POST['url'];
    if ($url == ""){
    echo "Invalid URL(s)";
    } else {
    $url = explode(" ", $url);
    $url = implode("\n", $url);
    $url = explode("\n", $url);
    $url = array_unique($url);
    $url = trim($url); #before $url = explode(" ", $url);
    
    then i add option to view the size of the files :
    
    $pos1 = strpos($rsurls,">| ");
    
    $pos2 = strpos($rsurls," KB");
    
    echo substr($rsurls, $pos1+3, $pos2-$pos1)." "; 
    
    # all lines right after if (preg_match("/FILE DOWNLOAD/", $rsurls)){
     
    foreach ($url as $urls){
    $rsurls = @file_get_contents($urls);
    if (preg_match("/FILE DOWNLOAD/", $rsurls)){
    echo '<a href="'.$urls.'"><font color="green">'.$urls.'</font></a> - Valid<br />';
    } else {
    echo '<a href="'.$urls.'"><font color="red">'.$urls.'</font></a> - Dead<br />';
    }
    }
    echo "<br /><font size=\"2\">".sizeof($url)." Links Checked</font>";
    }
    }
    ?>
    <br /><br />
    </center>
    </body>
    </html>
    PHP:
     
    MasterOfDeath, Dec 10, 2009 IP
  2. MasterOfDeath

    MasterOfDeath Guest

    Messages:
    356
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    no help?? :(
     
    MasterOfDeath, Dec 11, 2009 IP