Login / Sign up
> > > json / jsonp format avail?


Messages in topic: json / jsonp format avail?
Saxan
Registered User

Nbr post: 4
Register: 9/27/02
Posted: 1/23/12, 12:24 AM

Do you guys have a json or jsonp format available for viewing profiles and items?

I wanted to scrape some of the html data, but your pages dont have a header that allows cross domain script access. Was curious if you had a way around this.

If you guys offered this with a query string parameter (such as /profile/123?format=json) or something, it would be really nifty.
loulina
Admin

Nbr post: 4235
Register: 2/8/06
Posted: 1/26/12, 4:56 AM

Hi Saxan,

We don't currently have a json view of the profile.
Out of curiosity, which information are you looking for in the profile?
Saxan
Registered User

Nbr post: 4
Register: 9/27/02
Posted: 1/29/12, 8:25 PM

Our guild defines a "guild standard" for our gear. Typically it is either associated with hp/mana sum, or else a zone of origin - to determine if a player's gear meets standard.

So, i was thinking it be useful, if i could write a simple javascript or php page that would let me put in a magelo id, and get a list of any items that do not meet guild standard. Right now, its a manual comparison process.. and it takes alot of time. Every class leader has to do it, not fun.

My result set would utlimately be a list of items and augs. It would be similar to the current profile page, where much of this data is stored in the items[..] array.

so maybe something like this, would be useful:
{
    "equipped_items": [
        {
            "slot": 0,
            "slot_desc": "charm",
            "item_id": 22203,
            "item_image_id": 1203
        },
        {
            "slot": 1,
            "slot_desc": "arms",
            "item_id": 22223,
            "item_image_id": 1223    
        }
    ],
    "equipped_augmentations": [
        {
            "aug_id": 12445
        },
        {
            "aug_id": 12425
        }
    ]
}

and a json format so we can inspect the item data:
e.g.
{
    "item": {
        "id": 22232,
        "desc": "blah blah blah",
        "img url": "/.../xxx.png",
        "zone_acquired": 55
        "hps": 22203,
        "mana": 1203,
        "stats": {
            "wis": 22,
            "int": 11
        },
        "heroics": {
            "wis": "+2",
            "int": "+3"
        }
    }
}


This data is already in your relational table, and you guys map it to html very nicely. Awesome job.

Just wanting to see if you could extend it to a format that can be easily reused - keeping the same structure essentially.

Thanks!

Also, I'd be glad to help if you need a hand with it.
Carnon
Advisor

Nbr post: 194
Register: 3/27/08
Posted: 2/15/12, 4:24 AM

I have relayed your alternative request to add http response header to allow cross domain scripting on magelo's server. allowing you to write code to scrape it.

When I recieve a response from the Magelo gods I will reply to your in game email. I like your idea and I do think that it would be a great tool for all guild leaders/officers to have this ability to see whos lacking in required gear and such.

-CaRn

CaRnon the Fabled Cleric
Realm of Insanity - Xegony
EQ Magelo Advisor/Moderator
Jelan
Admin

Nbr post: 11384
Register: 5/4/01
Posted: 2/23/12, 10:49 PM

Now that there is some context to what you actually try to achieve, I believe it would be much easier and simpler for everyone if we actually come up with a guild gear audit tool which is a pretty good idea.
Saxan
Registered User

Nbr post: 4
Register: 9/27/02
Posted: 3/7/12, 4:39 AM

That would be a nice feature.

My basic ideal query would be:

Guild Name: [Final Empire]
Class Name: [Necromancer]

Item Thresholds:
Hit Points:
unacceptable: [0.0000] to [1999.9999] web text color: [red]
acceptable: [2000.0000] to [2300.9999] web text color: [green]
preferred: [2301.0000] to [MAX.INTEGER] web text color: [blue]

Mana:
unacceptable: [0.0000] to [1999.9999] web text color: [red]
acceptable: [2000.0000] to [2300.9999] web text color: [green]
preferred: [2301.0000] to [MAX.INTEGER] web text color: [blue]

Aug Thresholds:
Hit Points:
unacceptable: [0.0000] to [99.9999] web text color: [red]
acceptable: [100.0000] to [130.9999] web text color: [green]
preferred: [131.0000] to [MAX.INTEGER] web text color: [blue]

Mana:
unacceptable: [0.0000] to [99.9999] web text color: [red]
acceptable: [100.0000] to [130.9999] web text color: [green]
preferred: [131.0000] to [MAX.INTEGER] web text color: [blue]


The output result set would be all necros, all gear, all augs. Each line item would be color coded red, green, blue(unacceptable, acceptable, preferred). The winning color would be: Min(HP value, Mana value) - in other words, if the item had 2 hps, but 2300 mana.. it be red not green.

Each line item would have a column for hp, mana, item name (with mouseOver doing then item preview popup), and slot name where it is currently equipped.

<character-name>
Items:
HP....MANA.....ITEM NAME... SLOT....
HP....MANA.....ITEM NAME... SLOT....
HP....MANA.....ITEM NAME... SLOT....
...
Augs:
....
....


If there was a guild tool management section, and i could save this audit threshold info, that be nice.

Then I could just everyone month or so, keep my query simple.
Guild Name: [Final Empire]
Class Name: [Necromancer]

[View Results button] [Edit Audit Thresholds button]

I was essentially going to write this, if I could get the data successfully mined out of your system =)

Although.. I am sure you could write a more verbose utility. To allow filtering on item stats and heroic amounts, .. allow queries by specific magelo ids as well as guild and classes, etc.