sentanos / roblox-js

!!!THIS PROJECT IS NO LONGER MAINTAINED!!! Execute ROBLOX website actions in node.js
MIT License
45 stars 45 forks source link

Top Bar Support? #37

Closed Conmmander closed 7 years ago

Conmmander commented 7 years ago

I've searched around and didn't seem to find any support to get whatever is inside the top status bar that is on players profile. Does this actually exist with roblox-js or do we have to make this ourselves?

sentanos commented 7 years ago

Getting a user's status message does not exist right now but is very easy to add - I will most likely put it in the next release.

Conmmander commented 7 years ago

Awesome! Thank you, I appreciate it.

Conmmander commented 7 years ago

I got code for this!

// Includes var http = require('./http.js').func; var parser = require('cheerio');

// Args exports.required = ['userId'];

// Define exports.func = function (args) { return new Promise(function (resolve, reject) { http({ url: 'https://www.roblox.com/users/' + args.userId + '/profile' }) .then(function (body) { var matches = body.match(/data-statustext="?(.*?)"? data-edit/); resolve((matches && matches[1]) ? matches[1] : false); }) }) }