<?php
function Match($str, $re) {
$matches = array();
preg_match($re, $str, $matches);
return count($matches) > 0 ? $matches[0] : NULL;
}
$args = array("id" => 77949);
$data = file_get_contents("http://ru.wowhead.com/item=".$args["id"]."&power");
$item = array(
"name" => "",
"quality" => 0,
"icon" => 0,
"tooltip" => ""
);
$item["name"] = Match($data, "/name_ruru: '(.+)'/");
$item["quality"] = Match($data, "/quality: '(.+)'/");
$item["icon"] = Match($data, "/icon: '(.+)'/");
$item["tooltip"] = Match($data, "/tooltip_ruru: '(.+)'/");
print(json_encode($item, JSON_UNESCAPED_UNICODE));
?>
preferences:
37.86 ms | 402 KiB | 5 Q