tass2001 Posted December 13, 2007 Share Posted December 13, 2007 I keep getting errors from this script, can anyone tell what i'm missing? <?PHP $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; $LOGINURL = "http://www.myspace.com/imparanoid000"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$LOGINURL); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); $result = curl_exec($ch); curl_close($ch); preg_match_all(#<tr>[^<]*?<td[^>]*?>[^<]*?<a href="([^"]*?)">([^<]*?)</a>[^<]*?<br>[^<]*?<br>[^<]*?<a[^>]*?>[^<]*<img src="([^"]*?)"[^>]*?>[^<]*?</a>.*?</td>[^<]*?<td[^>]*?>[^<]*<span[^>]*?>([^<]*?)</span>[^<]*<br>[^<]*<br>(.*?)</td>[^<]*?</tr>#is, $sConents); echo $sContents; ?> Quote Link to comment Share on other sites More sharing options...
peranha Posted December 13, 2007 Share Posted December 13, 2007 you have echo $sContents, and it the line before it it is sConents Quote Link to comment Share on other sites More sharing options...
tass2001 Posted December 13, 2007 Author Share Posted December 13, 2007 Whoops let me see now if it works Quote Link to comment Share on other sites More sharing options...
tass2001 Posted December 13, 2007 Author Share Posted December 13, 2007 Hmm I keep getting Parse error: syntax error, unexpected ';' Expecting ')' in Comment.php on line 15 Quote Link to comment Share on other sites More sharing options...
peranha Posted December 13, 2007 Share Posted December 13, 2007 Is this your comment.php page, or is that page somewhere else? Quote Link to comment Share on other sites More sharing options...
tass2001 Posted December 13, 2007 Author Share Posted December 13, 2007 No, this is my comment.php page, it a script made to just get comments from a myspace profile using PCRE Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted December 13, 2007 Share Posted December 13, 2007 this preg_match_all(#<tr>[^<]*?<td[^>]*?>[^<]*?<a href="([^"]*?)">([^<]*?)</a>[^<]*?<br>[^<]*?<br>[^<]*?<a[^>]*?>[^<]*<img src="([^"]*?)"[^>]*?>[^<]*?</a>.*?</td>[^<]*?<td[^>]*?>[^<]*<span[^>]*?>([^<]*?)</span>[^<]*<br>[^<]*<br>(.*?)</td>[^<]*?</tr>#is, $sConents); has to be preg_match_all("#<tr>[^<]*?<td[^>]*?>[^<]*?<a href="([^"]*?)">([^<]*?)</a>[^<]*?<br>[^<]*?<br>[^<]*?<a[^>]*?>[^<]*<img src="([^"]*?)"[^>]*?>[^<]*?</a>.*?</td>[^<]*?<td[^>]*?>[^<]*<span[^>]*?>([^<]*?)</span>[^<]*<br>[^<]*<br>(.*?)</td>[^<]*?</tr>#is", $results, $sContents); notice the quotes also you have to add $results, and it should not be print $sContents it should be print_r($sContents) hope its helpful Quote Link to comment Share on other sites More sharing options...
tass2001 Posted December 13, 2007 Author Share Posted December 13, 2007 That helped but now i'm getting an "HTTP 500 Unknown Server error" ??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.