Skip to content

quantiom/brainly-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brainly-JS

Interact with brainly.com in NodeJS. Logging in with an account is optional.

Example

const Brainly = require('brainly-js');
let client = new Brainly('email', 'password'); // logging in is optional

// logging in is not required for these functions
client.searchQuestions('square root of 4', 10).then(questions => { /* ex: question.answers */ });
client.getQuestion('question ID').then(question => { /* ex: question.answers */ });

// being logged in is required for responding and asking questions
client.on('logged_in', token => { // token is the 'x-b-token-long' header used for authorization in requests
  client.addResponse('question ID', 'This is a response.').then(console.log); // respond to a question
  client.askQuestion('This is a question.', 'Mathematics', 10).then(console.log); // ask question for 10 points in the Mathematics category
});

Requirements

Installing

npm i brainly-js , or clone the git repo.

About

Interact with brainly in NodeJS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published