aue / BetterGaia

The extension framework for a better Gaia.
https://chrome.google.com/webstore/detail/bettergaia/lmgjagdflhhfjflolfalapokbplfldna
MIT License
2 stars 1 forks source link

Add API Documentation #3

Open HelloKitty opened 7 years ago

HelloKitty commented 7 years ago

I noticed you access some GaiaOnline API that isn't obviously found by surfing. For a few hours I sat around with Fiddler and never came across profiles?mode=lookup&avatar_username={user}. I'd love if you added some documentation for the API endpoints you know of.

Specifically, if you care, I'm looking for an endpoint that can translate a user_id to an avatar_username. Do you happen know? I know you go from user_id or avatar_username to the avatar assets on the CDN but is there a way to query for the avatar_username associated with a user_id? Maybe it's obvious but I'm missing something.

Anyway, documentation of the known sections of the API would be very helpful!

aue commented 7 years ago

Hopefully the following can help you, as I haven't worked actively on BetterGaia for years by now.

Since BetterGaia is a web extension, it is able to take advantage of the fact that the user is signed in and simply fetches the actual pages that would have pertinent data and parses them for it. Aside from that, I cannot recall any part of BetterGaia that looked up a user's username from the id.

I don't believe that there is much of an usable API to begin with, since Gaia is more of a patchwork of code built-up from over the years. From the events and site features that Gaia added, there was never an unified, shared API that was built upon. I remember when the Gaia mobile app was first released there was an API that was built specifically for it, but I'm not sure if it still exists. That might be a interesting part to peek into.

In your case, I do know that when you use an user id to access an user's profile via URL, it redirects you to a form that contains the username in it. So if you went to http://www.gaiaonline.com/profiles/16223135/ it would redirect you instead to http://www.gaiaonline.com/profiles/lm-a-kitty-cat/16223135/ Of course, the username is a bit different from how it is actually styled, and I'm not sure how it handles special cases.

Hopefully this helps.

HelloKitty commented 7 years ago

Yea, I knew it wasn't too active but there aren't many resources to be tapped about this. I didn't except a response so quickly, I appreciate it!

You're right, no part of BettarGaia does that as far as I can see. BetterGaia does use profiles?mode=lookup, which can map a username to a userid, I was just hoping maybe you were familiar with an unused way to do the reverse. It was a longshot.

You are in fact right that it will redirect, it sends a Location header back, and while it might be possible to parse the Location header's value for the username I'm unable to really do that in the context of what I'm working on.

Also, is it a coincidence that you've used my Gaia Online profile as an example? Because I am Lm a Kitty Cat lol.

It does help but doesn't solve the problem I face atm, thank you though!

aue commented 7 years ago

Well I did take a look at the video of your Unity project that I guessed that this was about.

There is another extension that I see is actively being developed called GaiaUpgrade that I don't know if you've seen. I see that the user Knight Yoshi has been working on it. He's been around as long (maybe even longer) as BetterGaia has been around, but on other Gaia related extensions. Maybe he may be of assistance.

HelloKitty commented 7 years ago

Oooh I see, I didn't think anyone had seen that.

Hmmm, yes I'll go take a look. I'm hesitant to ask the same question though since I can't really think of a reason any addons/extensions/toolbars would need to get usernames from their id. You are right that this pertains to something Unity related. I personally like to refer to objects by unique entity IDs that encode a UID and some information in them. Similar to World of Warcraft GUIDs, where I got the idea. I can't do that for anything Gaia related if I can't reliably query a username from an ID though. I guess I could keep track of it myself as they log in though.

I will definitely dig around through that link you posted though! Thank you very much.