by tyrence » Sun Jun 10, 2012 4:05 am
Khuri wrote:tyrence wrote:How much work would it be to change the [item], [itemname], and [itemicon] tags to include the lowid, highid, imageid, and ql?
Simply said: right now impossible, because we don't have these information in our database at all. So we can't parse it. All we have is the item id you get, plus the item name and the image itself (which you get displayed when rendering the page normally, not on the parser; we could include those information tho, if it would be of any help).
If you included the name and the image id (along with the item id), then we wouldn't have to do a lookup. The image id is part of the image url, so if you wanted to just include the image url, I could parse the image id from it (for instance,
http://static.aodevs.com/icon/99180 -> 99180 is the image id).
Khuri wrote:
tyrence wrote:
Also, it would make it easier to parse if the tags that didn't have a closing tags were self closed(like in xml).
Sorry, i don't really understand this one. Do you have a parser now that already understands it? Then the change seems not required. If you don't... what language is your bot? Because filtering those 7 tags in total could basically be written with a small regex in a minute. That answer depends of course on how you handle the text.
Well I actually wrote a parser for it that parses the tags and builds a DOM tree, and then I take the DOM tree and traverse it to get AOML output. And I did this instead of just using regex replace because for some of the tags, particularly the item/itemicon/itemname tags, I have to do a lookup to know what to replace it with. It is possible to do with regex but it gets kinda messy and writing a parser wasn't too much work. Anyway, the reason this would help is because, for instance, this guide (
http://www.ao-universe.com/mobile/parse ... bot&id=443) has a tag (goto) that isn't listed on the api page, so the parser doesn't know if it should wait for a closing tag or not. If the tags were self-closed when they didn't have an explicit closing tag then the parser could handle unknown tags more gracefully.
[quote="Khuri"][quote="tyrence"]How much work would it be to change the [item], [itemname], and [itemicon] tags to include the lowid, highid, imageid, and ql?[/quote]
Simply said: right now impossible, because we don't have these information in our database at all. So we can't parse it. All we have is the item id you get, plus the item name and the image itself (which you get displayed when rendering the page normally, not on the parser; we could include those information tho, if it would be of any help).[/quote]
If you included the name and the image id (along with the item id), then we wouldn't have to do a lookup. The image id is part of the image url, so if you wanted to just include the image url, I could parse the image id from it (for instance, http://static.aodevs.com/icon/99180 -> 99180 is the image id).
[quote="Khuri"]
[quote="tyrence"]
Also, it would make it easier to parse if the tags that didn't have a closing tags were self closed(like in xml).[/quote]
Sorry, i don't really understand this one. Do you have a parser now that already understands it? Then the change seems not required. If you don't... what language is your bot? Because filtering those 7 tags in total could basically be written with a small regex in a minute. That answer depends of course on how you handle the text.[/quote]
Well I actually wrote a parser for it that parses the tags and builds a DOM tree, and then I take the DOM tree and traverse it to get AOML output. And I did this instead of just using regex replace because for some of the tags, particularly the item/itemicon/itemname tags, I have to do a lookup to know what to replace it with. It is possible to do with regex but it gets kinda messy and writing a parser wasn't too much work. Anyway, the reason this would help is because, for instance, this guide (http://www.ao-universe.com/mobile/parser.php?mode=view&bot=tyrbot&id=443) has a tag (goto) that isn't listed on the api page, so the parser doesn't know if it should wait for a closing tag or not. If the tags were self-closed when they didn't have an explicit closing tag then the parser could handle unknown tags more gracefully.