I can give you a quick example, but to answer your question yes you have to start broad and narrow down to what you want manually through Blizzard's XML. I'll show you a small snippet from a project I am currently working on.
PHP Code:
/* Set the user agent to get XML data from Blizzard */
ini_set("user_agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
function get_battlegroups($link) {
$url = "http://www.wowarmory.com/battlegroups.xml";
$xml = simplexml_load_file($url);
foreach ($xml->battlegroups->battlegroup as $battlegroup) {
$ladder_url = mysqli_real_escape_string($link, $battlegroup['ladderUrl']);
if (!mysqli_query($link, "INSERT INTO battlegroups (battlegroup_url) VALUES ('$ladder_url')")) {
printf("Error: %s\n", mysqli_sqlstate($link));
}
}
}
First of all you need to set a user agent to get the xml instead of formated html. Then the function basically grabs a list of every BG and saves it to a database.
Soon you will find that you are going to run into problems when you want to pull specific achievement/statistic data. To do this you need to append &c=# to the end of the achievement or statistic URL.