蒸汽的WebAPI:获取应用程序的价格 [英] Steam WebAPI: Get the price of an app

查看:228
本文介绍了蒸汽的WebAPI:获取应用程序的价格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种可能性,在从的WebAPI蒸汽得到一个游戏的价格?我使用PHP。

Is there a possibility to get the Price of a Game from Steam over the WebAPI? I am using PHP.

推荐答案

您可以检查 GetSupportedAPIList (可用的这里),看到那里似乎不是一个办法让价格的应用程序。

You can check the GetSupportedAPIList (available here) and see that there doesn't seem to be a way to get the Price of an app.

修改这里的code做你的要求为您的评论:

Edit Here's the code to do what you're asking for in your comment:

样品code是一个大一点,因为我不得不将编码的欧元符号正常显示,但你应该能够提取你需要从它:

The sample code is a bit bigger because I had to set the encoding for the Euro sign to display properly, but you should be able to extract what you need from it:

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body>
<?php

$string = "Other Data in the document<div class=\"game_purchase_price price\" itemprop=\"price\">49,99€</div>Some More Data!";
$regex = "/\<div class\=\"game_purchase_price price\" itemprop\=\"price\"\>(.*?)\<\/div\>/";
preg_match_all($regex, $string, $matches);

for($i = 0; $i < count($matches[1]); $i++)
{
    $match = $matches[1][$i];
    echo $match;
}

?>
    </body>
</html>

我在字符串中增加了垃圾,所以你可以看到,前pression将能够提取即使一个更大的文档包含在 DIV 。

这篇关于蒸汽的WebAPI:获取应用程序的价格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆