NodeJS open source RAP checker

I whipped up a very simple (and fast) NodeJS rap checker for developers to use in their games (you can easily combine this with a web server running ExpressJS)

You can check it out here:

If you think any major optimizations can be done (to make it faster), or any bug fixes please do feel free to either post here or send a pull request (I’m still learning git, so this is fun!)

An example how to use it would be to require the “roblox.js” file, and execute this in your code:

const ROBLOX = require("./lib/roblox")

    new ROBLOX(1).getRAP()
        .then((data) => {
            console.log(JSON.stringify(data))
        })
        .catch((err) => {
            console.log("Failure grabbing RAP for user.")
            console.error(err.stack)
        })

This would get the RAP for the user ROBLOX.

16 Likes

Nice, looks pretty clean also did you creare your roblox module? If you did you should put it on npm to make it more convenient for people who would rather just require it (if they want to use it in a larger project).
Regardless of what you decide to do thanks for that.

Yeah the roblox module is actually the rap checker, it’s just named weirdly.

Stil trying to learn NodeJS and the whole async / await thing, It’s very weird to me.

1 Like

Even though Roblox+ by WebGL3D exists, this is still nice if you don’t have Roblox+ (Which you should have by now.) and want a more advanced, but sort of quicker way if your internet is kinda bad and it takes like 10 seconds to load a Roblox page, which by now in 2019 shouldn’t happen.

Overall, good job.

Roblox+ doesn’t have a public API, if a developer wanted to make a game that had a rap checker there would be no way to do it unless you run your own web server + rap checker script (which I provided)

1 Like

Oh, now I see the use for this. Had to read the top again so I understood, anyway this is a great way for developers to show the RAP in a player like on a leaderboard like Trade Hangout did.

This is a wonderful and useful module! Definitely will be useful for some APIs. Cheers!

As Cherry says above this isn’t really for the user to use to check RAP (as you said, Roblox+ exists) it’s for developers to have a way to check it, for roblox discord bots.

2 Likes

A bit off-topic, but I asked my friend to copy the code as much as he could and re-make it in Golang. He did this and his version manages to get all of Roblox’s RAP in 1.9 seconds (while mine is 4).

This doesn’t necessarily mean my version is inferior, It’s just that Go is just generally faster than NodeJS since it’s compiled. But if you’re going for extreme performance you should keep this in mind!

It’s likely a location thing, if your friend is closer to where Roblox’s servers are located they may load it faster because of that. My server, also written for Node.js, loads Roblox’s inventory in 1.8, so it’s not a Node vs Golang issue. The processing time difference for the requests should be negligible between languages compared to the time spent waiting for a response.

1 Like

If you wouldn’t mind, could you run my script on your server and see if it loads it in 1.8 seconds?

It might just be my programming is bad - probably the case.

Your friend could have been running his off of a much faster internet connection than yours. When you’re sending that many requests, having even 5% faster internet would make a big difference.

I’d rather not run other people’s code on my server, sorry. I wrote mine before all the fancy ES6 stuff got to the LTS, so I’m not entirely sure how to follow through this code in my head atm, but if all of the asset types aren’t loading simultaneously, that’s where your bottleneck is.

2 Likes

Can I use this to make a RAP leaderobard?

You could, yeah. But you’d need to set up a REST API that uses it.

I’ve already done something like this before (but it was never public, It’s extremely old, and abandoned):

I wouldn’t suggest hosting that, but you could learn from it.

EDIT: Applied a MIT license to it, since I don’t care what people do with it.