C
C
cherurg2014-11-08 22:36:32
vBulletin
cherurg, 2014-11-08 22:36:32

How can I authorize a nodejs bot on a forum under vbulletin?

Hello!
I, like, and googled on this topic, but the results are difficult for me to understand. Basically, authorization is written as a thing on the server side, and is used as php code.
I have another task. You need to write a bot that will log in to the forum with the vBulletin engine, and then parse some pages under the specified account.
How can I log in to the bot? In what form and how is data sent from the client to the server with authorization information? I've seen http request headers being used, but I can't be sure. In general, a complete noob in this matter. I would be grateful if someone would give me a read about how the server communicates with an already authorized client.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Aksentiev, 2014-11-08
@Sanasol

Well, nodejs itself is not very suitable for this, although I could be wrong.
I would advise looking towards the server browser.
Something like Phantom.js
But there are higher-level (more convenient to work with pages and in general) phantom-based wrappers, such as Casper .
Here is something very simple and recently released by Nightmarejs

S
Sergey, 2014-11-08
Protko @Fesor

In a very primitive case, authorization for the client works like this:
- the user submits the form data in a POST request. That is, the data is written to the request body, not to the headers.
- if we talk about PHP, then when the session_start function is called (or automatically if set in php.ini), a session file is created (again, it can be stored in memory in Reddis, as configured) and the user is assigned a cookie with a session ID. This same cookie is set through the response headers:
Then, with each request to the server, you will also need to send these cookies in the headers, otherwise the server will think that you are a new dude and will create a new session for you.
In the session, on the server, everything that is connected with authorization is usually stored. That is, in most cases, you just need to send the cookies that you set from the server and resolve this matter.
But alas, this is only the most common method of authorization, as far as I remember, in the same IPB, sessions were usually additionally tied to your IP and a bunch of other things, such as separate tokens in the URI, but I honestly don’t remember anymore, I haven’t worked with these things for a long time.
In your case, the simplest solution would be to arm yourself with phantomjs and just automate user actions. All these things like saving and handling cookies are supposed to be done for you. You just need to write down the sequence of actions. It will also be much easier to parse.

K
Konstantin Kitmanov, 2014-11-09
@k12th

Have you looked at the finished modules? roboto , crawler , simplecrawler ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question