Search code examples
androidparsingwiki

Parsing dota2.gamepedia.com - Android


I would like to get all information about Dota2 items I can get. Essential ones are their prices, names, thumbnail picture URLs, but other information are also welcome, like the way you buy them (for instance, you buy a Moon Shard by buying two Hyperstones).

There is a Dota2 Wiki page and there is a way to parse Wiki pages, but this didn't work. Apparently Wiki's APIs doesn't work on http://dota2.gamepedia.com.

I need this information on Android platform.

Any help?


Solution

  • I have actually been actively researching this same thing.

    Scraping from a wiki is far too brittle (layout/website updates), why not get the data straight from valve's mouth? They have an online item viewer which consumes json item data, I was able to track down where exactly this gets published and plan on using it in a future android app as well.

    The json data can be retreived via this link.

    Once you have that look into something like retrofit to parse this data directly into objects.

    Personally however, I would consume it through some other method and store it in your own database so your app isn't dictated by the structure of the data they push.

    Hope this helps!