Altcoins Talks - Cryptocurrency Forum

Crypto Discussion Forum => Forum related => Bugs & Tech support => Topic started by: bitmover on January 04, 2024, 07:44:15 PM

Title: Problems while trying to login using curl and php (creating a notification bot)
Post by: bitmover on January 04, 2024, 07:44:15 PM
I am trying to create a notification bot for the forum.

I don't want to scrap all posts for now (as I have limit resources, the server was donate by examplens).

I will use the forum's search function (I think it will work pretty well for the notification bot), and to use the search the user must be logged in.

I have been trying to log in using CURL PHP, and my server can't handle headless browsers for now.
but I always get error messages.

Code: [Select]
An Error Has Occurred!
I might be doing something wrong in my code. Maybe the dev team can help me? Maybe some guide somewhere?

Is there any security system which might be blocking bots trying to login? I think hashLoginPassword function is blocking me, as I can't reproduce it in PHP.

Maybe some backdoor?
For example, bitcointalk has a bypass captcha URL.

Thanks in advance!
Title: Re: Problems while trying to login using curl and php (creating a notification bot)
Post by: dkbit98 on January 05, 2024, 01:55:21 PM
I am trying to create a notification bot for the forum.
Good idea!
Are this notifications going to work with telegram or directly with forum?

I will use the forum's search function (I think it will work pretty well for the notification bot), and to use the search the user must be logged in.
Have you tried using altcoinstalks search?
I think it works slower and worse than bitcointalk search, but both of them are not great.
Title: Re: Problems while trying to login using curl and php (creating a notification bot)
Post by: examplens on January 05, 2024, 02:05:21 PM
I am trying to create a notification bot for the forum.
Good idea!
Are this notifications going to work with telegram or directly with forum?

I think it is modelled on the "Loyce notification bot", where the user would have his web page with "mentions" posts.

It's a pity that we don't have notifications here  :o, now I would mention @admin and he would be activated in this topic.
Title: Re: Problems while trying to login using curl and php (creating a notification bot)
Post by: bitmover on January 05, 2024, 04:23:53 PM
I will use the forum's search function (I think it will work pretty well for the notification bot), and to use the search the user must be logged in.
Have you tried using altcoinstalks search?
I think it works slower and worse than bitcointalk search, but both of them are not great.

This is exactly what I am trying to do.

I can login into bitcointalk.org using my CURL PHP code, but I can't login here.. I don't know what is happening...

And to use the search you must be logged in.

I will share my code soon (I am away from my computer now)
Title: Re: Problems while trying to login using curl and php (creating a notification bot)
Post by: admin on January 05, 2024, 04:38:43 PM
 let me look into this, i don't want to put too much strain on server resources, search is surely the worst case to approach it (also search turns off if load is too high). By the way, notification email are available but limited to certain ranks : https://www.altcoinstalks.com/index.php?topic=63.0
Title: Re: Problems while trying to login using curl and php (creating a notification bot)
Post by: bitmover on January 05, 2024, 04:52:33 PM
let me look into this, i don't want to put too much strain on server resources, search is surely the worst case to approach it (also search turns off if load is too high). By the way, notification email are available but limited to certain ranks : https://www.altcoinstalks.com/index.php?topic=63.0

Server resources might bee a problem, depending on how many people use it

The rank is

Quote
Royalty Are:

- Forum users who have donated more than 0.1 ETH, to help with forum expenses.

- Request notifications on replies and topics

However,  it still doesn't have quote notifications  (the most important imo.)
Title: Re: Problems while trying to login using curl and php (creating a notification bot)
Post by: admin on January 05, 2024, 05:19:02 PM
let me look into this, i don't want to put too much strain on server resources, search is surely the worst case to approach it (also search turns off if load is too high). By the way, notification email are available but limited to certain ranks : https://www.altcoinstalks.com/index.php?topic=63.0

Server resources might bee a problem, depending on how many people use it

The rank is

Quote
Royalty Are:

- Forum users who have donated more than 0.1 ETH, to help with forum expenses.

- Request notifications on replies and topics

However,  it still doesn't have quote notifications  (the most important imo.)

search is problematic, had to shut it down often, will see what can be done for mentions
Title: Re: Problems while trying to login using curl and php (creating a notification bot)
Post by: bitmover on January 05, 2024, 06:01:26 PM
search is problematic, had to shut it down often, will see what can be done for mentions

For notifications search could be limited to maxage=7, or even maxage=3.
Would that still consume that much resources?

Because only recent mentions are important, and there are not so many posts to search when we narrow thee age limits
Title: Re: Problems while trying to login using curl and php (creating a notification bot)
Post by: admin on January 06, 2024, 01:15:23 AM
search is problematic, had to shut it down often, will see what can be done for mentions

For notifications search could be limited to maxage=7, or even maxage=3.
Would that still consume that much resources?

Because only recent mentions are important, and there are not so many posts to search when we narrow thee age limits

give me time to look into it, i have so many burning fires, i am afraid to start a new one
Title: Re: Problems while trying to login using curl and php (creating a notification bot)
Post by: yahoo62278 on January 06, 2024, 10:28:59 AM
@bitmover quit breaking shit lol. Kidding of course, a notification bot would be a great addition to the forum. Let's hope to get this solved asap.
Title: Re: Problems while trying to login using curl and php (creating a notification bot)
Post by: DaNNy001 on January 15, 2024, 02:46:32 PM
@bitmover quit breaking shit lol. Kidding of course, a notification bot would be a great addition to the forum. Let's hope to get this solved asap.
I am eager waiting for bitmover to get things right because that notifier will indeed get things popping and even more speedy because you will be getting heads up whenever someone tries to say shit on your post and will definitely get the angle to right back at him 😁😁. But it's seem creating one for the community here is giving him tough time, I just hope you get it right soon .
Title: Re: Problems while trying to login using curl and php (creating a notification bot)
Post by: bitmover on January 17, 2024, 09:36:25 PM
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

Code: [Select]
<?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($curlCURLOPT_URL$login_action_url);
curl_setopt($curlCURLOPT_POSTtrue);
curl_setopt($curlCURLOPT_POSTFIELDShttp_build_query($postValues));

curl_setopt($curlCURLOPT_SSL_VERIFYHOSTfalse);
curl_setopt($curlCURLOPT_SSL_VERIFYPEERfalse);

curl_setopt($curlCURLOPT_HEADERtrue);
curl_setopt($curlCURLOPT_COOKIESESSIONfalse);
curl_setopt($curlCURLOPT_COOKIEJAR$cookie_file);
curl_setopt($curlCURLOPT_COOKIEFILE$cookie_file);
curl_setopt($curlCURLOPT_USERAGENTUSER_AGENT);
curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);

curl_setopt($curlCURLOPT_REFERER$login_url);
curl_setopt($curlCURLOPT_FOLLOWLOCATIONtrue);

$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));
}
Title: Re: Problems while trying to login using curl and php (creating a notification bot)
Post by: admin on January 17, 2024, 10:09:07 PM
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

Code: [Select]
<?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($curlCURLOPT_URL$login_action_url);
curl_setopt($curlCURLOPT_POSTtrue);
curl_setopt($curlCURLOPT_POSTFIELDShttp_build_query($postValues));

curl_setopt($curlCURLOPT_SSL_VERIFYHOSTfalse);
curl_setopt($curlCURLOPT_SSL_VERIFYPEERfalse);

curl_setopt($curlCURLOPT_HEADERtrue);
curl_setopt($curlCURLOPT_COOKIESESSIONfalse);
curl_setopt($curlCURLOPT_COOKIEJAR$cookie_file);
curl_setopt($curlCURLOPT_COOKIEFILE$cookie_file);
curl_setopt($curlCURLOPT_USERAGENTUSER_AGENT);
curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);

curl_setopt($curlCURLOPT_REFERER$login_url);
curl_setopt($curlCURLOPT_FOLLOWLOCATIONtrue);

$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));
}

we had multiple bot signups waves in 2019 and 21 if i am not mistaken, i did something, i don't remember exactly what
this forum have been extensively changed since 2017, not easy to remember what have been done,
in 1-2 weeks i'll give you access to a test version of the forum, and you can test.