hey admin.
I own a bot in bitcointalk, which is very similar, but I really can't make any bot work here. I just can't login into the forum.
Bitcointalk allows each user to have an unique URL which allows you to login without catcha, simple straight foward login URL. Is there anything similar here?
Can you give me a help?
This is my code. I have tried to use sSessionID, sSessionVar but they didn't help. I found no reference for it in SMF forum discussions
<?php
$login_url = 'https://www.altcoinstalks.com/index.php?action=login';
// The login credentials
$username = 'bitmoverbot';
$password = getenv('ALTCOINSPASSWORD');
$cookielength = -1;
$cookie_file = 'cookies.txt';
define('USER_AGENT', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.2309.372 Safari/537.36');
// Initiate cURL.
$curl = curl_init();
// Login
$postValues = array(
'user' => $username,
'passwrd' => $password,
'cookielength' => $cookielength,
);
// Go to Login
$login_action_url = 'https://www.altcoinstalks.com/index.php?action=login2';
curl_setopt($curl, CURLOPT_URL, $login_action_url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postValues));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_COOKIESESSION, false);
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($curl, CURLOPT_USERAGENT, USER_AGENT);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_REFERER, $login_url);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
$data = curl_exec($curl);
preg_match("/sSessionVar: '([^']+)'/", $data, $sessionVar);
preg_match("/sSessionId: '([^']+)'/", $data, $sessionId);
// Check for errors!
if (curl_errno($curl)) {
throw new Exception(curl_error($curl));
}