nemoku Posted December 20, 2009 Share Posted December 20, 2009 Am getting error (this is an script) who'll send automatic message to dating portal (one.lt) Error Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit in safe mode in /home/treo/public_html/themes/Gillette/curl.php on line 29 Fatal error: Call to undefined function curl_init() in /home/treo/public_html/themes/Gillette/curl.php on line 40 Script source <?php /*********************************************/ // // CONFIG // /*********************************************/ /*********************************************/ $startPage=10; $lastPage=12; $login="in-blood"; $password="hacked"; $msg='Kestas says: "sveiki"'; /*********************************************/ // // END OF CONFIG // /*********************************************/ /*********************************************/ //DON"T EDIT ANYTHING BELOW set_time_limit(120); class Bot{ /* ** ** LOGIN ** */ function Login($login,$password) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,'http://w31.one.lt/logon.do'); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,'username='.$login.'&password='.$password.''); curl_setopt($ch, CURLOPT_REFERER, 'http://w31.one.lt'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__).'/tmp.txt'); curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/tmp.txt'); $site = curl_exec ($ch); if (curl_errno($ch)) { $error = 'Error #' . curl_errno($ch) . ': ' . curl_error($ch); return false; echo $error; } else { return true; } curl_close ($ch); } /* ** ** LOGOUT ** */ function Logout() { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,'http://w31.one.lt/logoff.do'); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__).'/tmp.txt'); curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/tmp.txt'); $site = curl_exec ($ch); if (curl_errno($ch)) { $error = 'Error #' . curl_errno($ch) . ': ' . curl_error($ch); return false; echo $error; } else { //echo $site; return true; } curl_close ($ch); } /* ** ** SendMSG ** */ function SendMsg($profile,$msg) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,'http://w31.one.lt/saveCommentaryMessage.do'); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,'forUserId='.$profile.'&msg='.$msg.''); curl_setopt($ch, CURLOPT_REFERER, 'http://w31.one.lt/'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__).'/tmp.txt'); curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/tmp.txt'); $site = curl_exec ($ch); if (curl_errno($ch)) { $error = 'Error #' . curl_errno($ch) . ': ' . curl_error($ch); return false; echo $error; } else { return true; } curl_close ($ch); } /* ** ** Get Profiles ** */ function GetProfiles($page) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,'http://w31.one.lt/navigate.do?st.view=4&st.id=community.distantfriends.list&st.friends.page='.$page.''); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__).'/tmp.txt'); curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/tmp.txt'); $site = curl_exec ($ch); if (curl_errno($ch)) { $error = 'Error #' . curl_errno($ch) . ': ' . curl_error($ch); return false; echo $error; } else { //echo $site; return $site; } curl_close ($ch); } }//end of class $nextPage=$_GET['p']; if($nextPage) {$p=$nextPage;} else {$p=$startPage;} if($p<=$lastPage) { $bot=new Bot(); $bot->Login($login,$password); $src=$bot->GetProfiles($p); $dom = new DomDocument; @$dom->loadHTML($src); $xpath = new DOMXPath($dom); $profs = $xpath->evaluate('//div'); for ($i = 0; $i < $profs->length; $i++) { $prof = $profs->item($i); $class = $prof->getAttribute('class'); $id = $prof->getAttribute('uid'); if($class=='photoW ' && $id!='') { echo "http://w31.one.lt/navigate.do?st.id=community.friendcommentary.page&st.friend=$id"; echo "<br>"; //echo $id.' ['.$j++.']<br>'; $bot->SendMsg($id,$msg); } } $bot->Logout(); echo '<meta http-equiv="refresh" content="0;url=?p='.++$p.'">'; } else { echo 'DONE'; } ?> Link to comment https://forums.phpfreaks.com/topic/185774-error/ Share on other sites More sharing options...
Buddski Posted December 20, 2009 Share Posted December 20, 2009 The first error is because your PHP is running in safe mode.. And the second error: Ensure that this line in your PHP.ini file is uncommented.. ;extension=php_curl.dll (PHP v5) Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-980935 Share on other sites More sharing options...
nemoku Posted December 20, 2009 Author Share Posted December 20, 2009 How can i fix it? Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-980946 Share on other sites More sharing options...
Buddski Posted December 20, 2009 Share Posted December 20, 2009 You need to edit your php.ini file Turn Safe Mode off and Uncomment the aforementioned line. Presuming you are using PHP 5? Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-980949 Share on other sites More sharing options...
nemoku Posted December 20, 2009 Author Share Posted December 20, 2009 Am using PHP 5.2.12. Maybe you have skype? Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-980951 Share on other sites More sharing options...
nemoku Posted December 20, 2009 Author Share Posted December 20, 2009 mate can you help me fix that? Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-980957 Share on other sites More sharing options...
Buddski Posted December 20, 2009 Share Posted December 20, 2009 You need to open your php.ini file and make the changes.. If you need help finding it put phpinfo(); into a PHP document and view it.. Under the section called 'Loaded Configuration File' will be the location of your php.ini file. Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-980961 Share on other sites More sharing options...
nemoku Posted December 20, 2009 Author Share Posted December 20, 2009 I'll try. maybe you know how to make it use multiple accounts? Because one.lt have time limit ~300 messages per hour... i have alot of account but dunno how to make use it.. Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-980962 Share on other sites More sharing options...
nemoku Posted December 20, 2009 Author Share Posted December 20, 2009 PLease. Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-980993 Share on other sites More sharing options...
Buddski Posted December 20, 2009 Share Posted December 20, 2009 I have given you the solution to your problem.. It takes a little bit of work on your part but its worth it.. If you are getting stuck working through my directions ask more questions about what stage you are getting stuck on and people will help, only if you want to help yourself. Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-980997 Share on other sites More sharing options...
nemoku Posted December 20, 2009 Author Share Posted December 20, 2009 I need help with make it use multiple accounts. Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-981021 Share on other sites More sharing options...
Buddski Posted December 20, 2009 Share Posted December 20, 2009 Did you fix the initial error that this topic was created for? Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-981022 Share on other sites More sharing options...
nemoku Posted December 20, 2009 Author Share Posted December 20, 2009 Not yet, but i need to help with make it use multiple accounts. Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-981032 Share on other sites More sharing options...
Buddski Posted December 20, 2009 Share Posted December 20, 2009 What exactly needs multiple accounts? Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-981033 Share on other sites More sharing options...
nemoku Posted December 20, 2009 Author Share Posted December 20, 2009 Script should use not one account like now... It's should send ~200 messages and change account, and repeat it.. Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-981098 Share on other sites More sharing options...
nemoku Posted December 21, 2009 Author Share Posted December 21, 2009 STill need help. Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-981711 Share on other sites More sharing options...
nemoku Posted December 22, 2009 Author Share Posted December 22, 2009 Please Link to comment https://forums.phpfreaks.com/topic/185774-error/#findComment-982186 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.