Autogrant badges from unavailable homepages?

5hy
by 5hy · 17 posts
8 months ago in IMVU Lounge
Posted 8 months ago · Author
I was looking in the badge directory and the bling directory for some badges and a lot of them had unavailable homepages due to their creators being MIA. Is there a way to get those badges now that you can't access their pages?
Posted 8 months ago
@5hy


If you know the badge id, you can run this bit of javascript in the developer console on any IMVU classic page to grant yourself the badge
Code
IMVU.grantBadge(BID)

BID is the badge id.

Don't know if the badge directory gives the BID though, if not the only place I know of to get it is the person's profile but you said they were unavailable so :tlaponder:
Posted 8 months ago · Author
@DataMine


I guess a version of their profile with the badge has been archived on the web archive then I can try getting the badge id by using inspect element on the grant button. I'll try it and report back on if it works.
Posted 8 months ago · Author
@DataMine

So I just found a random page from the bling directory and put it in the wayback machine. Doing inspect element on the grant badge button gives you a string like "grant-badge-x-x" all you need to copy is from the word badge onward and place it in quotations when running the command in the console.

Screenshot 2024-02-28 at 00.31.02.png


It worked great and I was able to get the badge. That being said the badge creators page has to be archived for this to work.

Screenshot 2024-02-28 at 00.31.09.png
Posted 8 months ago · Author
Just to add to this. The badge directory gives the badge ID of every autogrant badge it has indexed so you don't need to use the wayback machine at all. I just noticed this when I opened the directory today.
Posted 7 months ago
@5hy

It won't work for me. Can you help me at all please?
Posted 7 months ago
AJAX uses JavaScript to make requests to the server and handle the responses.

You're getting that error message because whatever page you're trying to run that on, they don't have AJAX included.

Even if they did, it would not work. You see the
IMVU
in the code
IMVU.grantBadge("grant-badge-x-x")
, that's a reference to a list of functions defined within whatever page has the get this badge button. If you look at the image I attached, it shows "grantBadge" in the list, meaning you can call that function.

Here is a page you can use: https://avatars.imvu.com/Punishment

Here is the code behind it:

Code
IMVU.grantBadge = function(bid) {
    $.ajax({
        type: "POST",
        url: '/api/service/grant_badge.php',
        data: 'sauce=xxxglizzyxxx=&badgeid=' + bid,
        success: function(response) {
            if (response['error']) {
                IMVU.okMessageBox.showPopup('Error getting badge', response.error);
            } else {
                IMVU.okMessageBox.showPopup('Badge Granted', 'You have received the badge.');
            }
            IMVU.okMessageBox.center();
        },
        error: function(o) {
            IMVU.okMessageBox.showPopup('Error getting badge', 'There was a problem communicating with the server');
            IMVU.okMessageBox.center();
        }
    });
};
Last edited by DataMine on Thu Mar 14, 2024 6:27 pm, edited 1 time in total.
Reason: Added inline bbcode and replace text color with something more readable
Posted 7 months ago
@Toolyx

The text color you chose was almost impossible to read against our dark background so I replaced it with cyan and the inline code bbcode
Code
[inlinecode][/inlinecode]
that you can find in the custom bbcodes drop down.

On a side note: I've been trying to replace JQuery on our site as much as possible since vanilla has come a long way, but man I do miss the AJAX syntax. I find it much easier and nicer than fetch.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT