Blastify
Modern ES6 Promise based API client for BlastHack
- Session
- Auth
- BlastHack API Methods
- MessageBuilder
๐ Documentation |
---|
# using npm
npm i blastify
# using yarn
yarn add blastify
# using pnpm
pnpm add blastify
Check all available methods in ๐ Documentation.
import { BlastHack, Auth } from 'blastify'; // ESM
// OR
const { BlastHack, Auth } = require('blastify'); // CommonJS
// Create BlastHack client, without auth
const blasthack = new BlastHack();
// Find user by nickname
blasthack.findUser('neverlane')
// Get user profile wall by id
.then((user) => blasthack.getWall(user.id))
.then((wall) => console.log(wall.posts))
.catch((error) => console.log(error));
// With auth
const neverlaneAccount = new Auth({
login: 'neverlane',
password: 'someverystrongpassword',
// if using 2FA Auth
async onTwoFactor(payload, changeProvider, retry) {
if (payload.type !== 'totp')
return changeProvider('totp');
const code = await magicFunctionThatGenerateCodeByUsername(payload.login);
retry(code);
}
});
neverlaneAccount.auth()
.then(async (session) => {
const blasthack = new BlastHack(session);
await blasthack.sendMessageInProfile(blasthack.userId, 'hello from blastify');
})
.catch((error) => console.error(error));
Since blast.hk (that using XenForo as engine for forum ) does not provide an open API, this library is based on the parsing of HTML site pages. If the site changes affect the HTML used for parsing, the library may break at any time and not give the expected result. I will try to update it as soon as possible. Use at your own risk!
MrCreepTon for his Shitty-BlastHack-Client-API