Information on query.php

Here you can ask your questions and post suggestions about site's development.
Post Reply
xCROv
Posts: 5
Joined:Fri Feb 22, 2019 9:58 pm

Information on query.php

Post by xCROv » Fri Feb 22, 2019 10:21 pm

Is there a way that query.php can retrieve item information? Like if I had a specific item ID I could get the AP and DP of the item?

Something like https://bdocodex.com/query.php?a=items& ... 14034&l=us would return the json data:

Code: Select all

"0": {
    "enchant_chance": "100.00",
    "damage": "18 ~ 22",
    "defense": 0,
    "accuracy": "10",
    "evasion": 0,
    "dreduction": 0,
    "need_enchant_item_id": "0",
    "durability": "100 / 100",
    "enchant_item_counter": 1,
    "edescription": "Item Effect<br><span style=\"color: #e9bd23\">   Extra Damage to All Species +10</span><br><span style=\"color: #e9bd23\">   Casting Speed +3 Level</span><br><br>- Enhancement Effect<br><span style=\"color: #e9bd23\">Extra AP against monsters up (enhancement level PRI or up)</span><br><span style=\"color: #e9bd23\">   Extra Damage to All Species Up</span><br><span style=\"color: #e9bd23\">   All AP Up</span><br><span style=\"color: #e9bd23\">   All Accuracy Up</span><br>"
  },
This would help a ton on a project I am working on to bring the bdcodex to discord VIA a bot. The biggest problem I have with scraping information off the website is that most of it is in td tags that don't allow you to get information easily. This wouldn't be a problem if the data was consistent but some skills/items/npc's lack information that others have.

Example:
https://bdocodex.com/tip.php?id=skill--3174&l=us - Has cooldowns listed.
https://bdocodex.com/tip.php?id=skill--2888&l=us - Doesn't have cooldowns listed.

This makes even trying to read the tables a consistency issue. Would be great if there was a solution to this where data was always output in a similar manner. Say if the cooldown was 0 it would could still be represented by "Cooldown: 0."

User avatar
Kiriak
Site Admin
Posts: 545
Joined:Wed Sep 11, 2013 10:30 am
Discord:Kiriak#5590

Re: Information on query.php

Post by Kiriak » Sat Feb 23, 2019 8:22 am

Unfortunately, currently there is no such API, which would allow you to get the data in such form. And to reduce the size of the page, unneeded data such as zero cooldowns is not included there.

However, you can still use the tip.php script to get the data by ID. For example: https://bdocodex.com/tip.php?id=item--10083&l=us&nf=on will give you contents of the popup tooltip for this item.
If you will omit the "&nf=on" parameter, you'll get a bit more html markup, but for the enhanceable items there will be a json array of the item's parameters.

That's as best as you can get at the moment.

xCROv
Posts: 5
Joined:Fri Feb 22, 2019 9:58 pm

Re: Information on query.php

Post by xCROv » Sat Feb 23, 2019 3:02 pm

Yeah. I was pulling information off the top and main page. I guess I will put things other than armor and weapons on hold until we have a system for this information. Thank you.

xCROv
Posts: 5
Joined:Fri Feb 22, 2019 9:58 pm

Re: Information on query.php

Post by xCROv » Sun Feb 24, 2019 6:29 am

Welp... I made good progress but I feel like I am going to probably call it quits on developing to support much more than items/armor and some skills. Currently there are to many variables that seem to change per ID page that make it hard to work with until an official method for getting the information is available. I would love to know if something like that ever comes up. I don't think it would be much different then what query.php is currently offering.

Image

--

Image

User avatar
Kiriak
Site Admin
Posts: 545
Joined:Wed Sep 11, 2013 10:30 am
Discord:Kiriak#5590

Re: Information on query.php

Post by Kiriak » Sun Feb 24, 2019 11:13 am

Looks good actually. As for the official API, let's discuss it again in the discord.

xCROv
Posts: 5
Joined:Fri Feb 22, 2019 9:58 pm

Re: Information on query.php

Post by xCROv » Sun Feb 24, 2019 7:34 pm

Kiriak wrote:
Sun Feb 24, 2019 11:13 am
Looks good actually. As for the official API, let's discuss it again in the discord.
That sounds great. Feel free to message me when ever you're on.

Post Reply