douqiao1413 2016-02-28 00:53
浏览 40
已采纳

从XML获取图像 - Steam

i take XML table from steam - information about steam user inventory for this link: http://api.steampowered.com/IEconItems_730/GetPlayerItems/v0001/?key=XXXX&SteamID=XXX

EXAMPLE:

{
            "id": 5267945040,
            "original_id": 4985950915,
            "defindex": 9,
            "level": 1,
            "quality": 4,
            "inventory": 3221225475,
            "quantity": 1,
            "rarity": 2,
            "flag_cannot_trade": true,
            "attributes": [
                {
                    "defindex": 6,
                    "value": 1116733440,
                    "float_value": 72
                },
                {
                    "defindex": 7,
                    "value": 1135152909,
                    "float_value": 338.11758422851563
                },
                {
                    "defindex": 8,
                    "value": 1052989602,
                    "float_value": 0.38153558969497681
                },
                {
                    "defindex": 75,
                    "value": 1457251200,
                    "float_value": 120885075771392
                },
                {
                    "defindex": 147,
                    "value": "models/weapons/stattrack.mdl"
                },
                {
                    "defindex": 39,
                    "value": 0,
                    "float_value": 0.38999998569488525
                },
                {
                    "defindex": 40,
                    "value": 0,
                    "float_value": 0.5
                },
                {
                    "defindex": 16,
                    "value": 1,
                    "float_value": 1.4012984643248171e-045
                },
                {
                    "defindex": 199,
                    "value": 30,
                    "float_value": 4.2038953929744512e-044
                },
                {
                    "defindex": 142,
                    "value": "models/weapons/w_snip_awp_icon.mdl"
                }
            ]

        }

How i can a download to array a weapon model and show it on my site.. As for this example

"value": "models/weapons/w_snip_awp_icon.mdl"

Sorry for bad english

  • 写回答

1条回答 默认 最新

  • dsfs21312 2016-02-28 01:10
    关注

    I myself am not too experienced with fetching XML data. I am pretty experienced with the steam API and will be glad too help you. From what I am reading you are trying to correlate the in-game view model models/weapons/v_snip_awp_icon.mdl with a image to show on your webpage.

    Here's a little template that may help.

    XML File:

    <aaaa Version="1.0">
       <bbb>
         <cccc>
           <dddd Id="id:pass" />
           <eeee name="hearaman" age="24" />
         </cccc>
       </bbb>
    </aaaa>
    

    PHP Snippet: (SimpleXMLElement is a good way to grab data within PHP without getting to advanced)

    $xml = new SimpleXMLElement($xmlString);
    echo $xml->bbb->cccc->eeee['name'];
    echo $xml->bbb->cccc->dddd['Id'];
    

    I would also recommend trying steamanalyst.com's api

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 YOLO检测微调结果p为1
  • ¥20 求快手直播间榜单匿名采集ID用户名简单能学会的
  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题