Jump to content

raffinare

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

raffinare's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. it's supposed to check the file, to see if it's available for download, the code below looks okay to me, what's wrong? if($row[2]==2) // 4shared check { $row[1]="http://www.".$row[1]; $index=getpage($row[1]); preg_match("/Download ([^<]+)<\/div>/",$index,$match); if(strpos($index,"The file is shared for public access and download.")===false || !$match) { mysql_query("UPDATE `v2links` SET `checked`='-1',`lastcheck`=NOW() WHERE `id`=".$row[0]); print "bad link\n"; logstr("log-c.txt","bad link\n"); } else { $words=trim($match[1]); $words=preg_split("/[_\.\-\s]/",$words); $lastword=array_pop($words); $words=implode(" ",$words); $words=preg_replace("/\s{2,}/"," ",$words); $caption=mysql_real_escape_string($words); unset($words); unset($match); preg_match("/<td>Size\:<\/td><td>([^<]+)<\/td>/",$index,$match); $fsize=$match[1]; unset($match); print "$caption :: $fsize\n"; logstr("log-c.txt","$caption :: $fsize\n"); mysql_query("UPDATE `v2links` SET `checked`='1',`lastcheck`=NOW(),`fsize`='$fsize',`caption`='$caption' WHERE `id`=".$row[0]); if(mysql_errno()) print mysql_error()."\n"; } } I'm wondering if the sharing website has changed anything, because for rapidshare it works fine, code: if($row[2]==1) // rapidshare check { $index=getpage($row[1]); if(strpos($index,"<p><script>alert(\"File not found.\")</script>File not found.</p>")===false && strpos($index,"This file has been deleted.")===false) { preg_match("/<form action=\"([^\"]+)\" method=\"post\">/",$index,$match); //print $index; if($match[1]) { $fpath=$match[1]; $index=getpage($fpath,"dl.start=Free",$row[1]); preg_match("/<\/font> \(([^\(]+)\)\.<\/p>/",$index,$match); $fsize=0; if($match[1]) $fsize=mysql_real_escape_string(strip_tags($match[1])); print $fsize."\n"; logstr("log-c.txt",$fsize."\n"); mysql_query("UPDATE `v2links` SET `checked`='1',`fsize`='$fsize',`lastcheck`=NOW() WHERE `id`=".$row[0]); if(mysql_errno()) print mysql_error()."\n"; } else { print "bad link\n"; logstr("log-c.txt","bad link\n"); mysql_query("UPDATE `v2links` SET `checked`='-1',`lastcheck`=NOW() WHERE `id`=".$row[0]); if(mysql_errno()) print mysql_error()."\n"; } } else { print "bad link\n"; logstr("log-c.txt","bad link\n"); mysql_query("UPDATE `v2links` SET `checked`='-1',`lastcheck`=NOW() WHERE `id`=".$row[0]); if(mysql_errno()) print mysql_error()."\n"; } } any help would be appreciated!
  2. Thanks for your help, I am a noob on php, started to learn a while back, the mediafire link is like this http://www.mediafire.com/?mneyk0ppcej and i'm not familiar on how to construct a regex expression according to their url, can you give some tips? thanks
  3. i'm trying to grab the file name from mediafire to my database caption, I have rapidshare working fine. here's the code for rapidshare if($type==1) { $words=$links[$j]; preg_match("/rapidshare\.com\/files\/\d+\/(.+)/",$words,$match); unset($words); $words=$match[1]; unset($match); $words=preg_split("/[_\.\-]/",$words); $lastword=array_pop($words); if($lastword=="html") array_pop($words); $words=implode(" ",$words); $words=preg_replace("/\s{2,}/"," ",$words); $caption=mysql_real_escape_string($words); unset($words); } How ever, i'm not sure which preg_match would be the correct one for mediafire.. appreciate any help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.