1. I have corrected the e-mail settings so that outgoing e-mails from these forums should be sent now. If you tried to Register or Reset your Password, please try again!
    Dismiss Notice

Census character queries with/without c:show

Discussion in 'Census: EverQuest II' started by ionian tinnear, Jul 20, 2017.

  1. ionian tinnear

    ionian tinnear New Member

    I'm trying to get attribute data for the /character/ node when my query also uses c:show=name,resists,stats,type

    When using a query like:

    http://census.daybreakgames.com/xml/get/eq2/character/?name.first_lower=ironico&locationdata.world=Halls of Fate&c:show=name,resists,stats,type

    returns the desired child nodes, but the <character ...> node only has the id attribute:

    <character id="450971707027">

    When using a query like (same as above with the cshow):

    http://census.daybreakgames.com/xml/get/eq2/character/?name.first_lower=ironico&locationdata.world=Halls of Fate

    returns all data (which I don't want, it's too slow!) but the <character ...> has all the attributes:

    <character visible="1" dbid="2184644" ts="1500519595.218571" last_update="1500519595.218571" version="3" displayname="Ironico (Halls of Fate)" crc="2320693788" playedtime="25568760" id="450971707027">

    How do I get the first query with the c:show included to still return the second queries <character ...> not attributes?
     
  2. Feldon

    Feldon Administrator Staff Member

    Welcome to the EQ2 Census forums!

    If you want ts and playedtime, you have to request them as well.

    http://census.daybreakgames.com/xml/get/eq2/character/?name.first_lower=ironico&locationdata.world=Halls of Fate&c:show=name,resists,stats,type,ts,playedtime

    Also just a suggestion to speed up your query, if you know the worldID of Halls of Fate (it's 605) then this is a faster query as locationdata.worldid and name.first_lower are both indexed and you're shrinking the pool of results that Mongo has to search against dramatically:

    http://census.daybreakgames.com/xml...resists,stats,type,ts,playedtime,locationdata


    Also I'll give you the advice I give everyone: If you are writing a PHP application, I do not recommend using XML as your data source. Use JSON. It's difficult to read in the browser, but PHP reads it so much more easily than XML. Some example code:

    Code:
    $data_json = file_get_contents ($url);
    $data_raw = json_decode ($data_json,TRUE);
    $data = $data_raw[0]; // we only want the 1st result
    unset ($data_json,$data_raw); // free up memory
    
    echo '<pre>';
    print_r($data); // dump the data to the screen
    echo '</pre>';
    
     
  3. ionian tinnear

    ionian tinnear New Member

    Thanks Feldon, I'll adjust to using worldid and not world name, and update the order. I appreciate all advice to make the queries more effectient.

    My app is a windows app. So I'll stick to XML for now!
     
    • Like Like x 1
  4. Feldon

    Feldon Administrator Staff Member

    Ah Windows app. Yeah I think the XML tools there are workable at least. The PHP ones seem to have been written after a long night with a bottle of bad tequila.
     

Share This Page