dqn8235 2014-01-05 11:17
浏览 136
已采纳

通过API访问Steam社区组[关闭]

I'm currently trying display events from a Steam community group on a forum (running vBulletin 4.2.1). I've looked at the Steam API's and none of the ones I can find give much access to groups, the most they seem able to do is to display a members list.

Is there an API which allows you to retrieve steam group events? or is there another way to do this?

  • 写回答

1条回答

  • dongxuying7583 2014-01-06 19:54
    关注

    There is not an API for this (yet), but you are able to get this information via the XML that Valve makes available.

    First, you need to know your group's groupID64 value. You can find this by examining the XML of a member of your group.

    Using Robin Walker as an example, we can look at his profile using this URL:

    http://steamcommunity.com/id/robinwalker/?xml=1
    

    In that XML, you'll find that he is a member of several groups. Each of them have a line like this:

    <groupID64>103582791429521412</groupID64>
    

    That value is what we need. That value is used in a URL like this to pull events by month

     http://steamcommunity.com/gid/103582791429521412/events?xml=1&action=eventFeed&month=$month&year=$year
    

    Where $month and $year are numerical values (ie. 1 and 2014 for January, 2014)

    This will return XML that looks like this if there are no events for the month:

    <response>
        <results>OK</results>
        <bPastMonth>0</bPastMonth>
        <monthName>January</monthName>
        <year>2014</year>
        <eventCount>0</eventCount>
        <expiredEventCount>0</expiredEventCount>
    </response>
    

    Or this for expired events:

    <response>
        <results>OK</results>
        <bPastMonth>1</bPastMonth>
        <monthName>December</monthName>
        <year>2013</year>
        <expiredEvent eventID="1387405180685446058">                <div class="eventBlock" id="1387405180685446058_eventBlock">
                        <div class="eventLeftBlock">&nbsp;</div>
                        <div class="eventDateBlock"><span class="hiliteTextRed">Sunday 22</span><br /><span class="eventDateTime">10:26am</span></div>
                        <div class="eventBlockIcon">
                            <div class="playerAvatar"><a href="http://steamcommunity.com/groups/tf2scrap#events/1387405180685446058"><img src="http://media.steampowered.com/steamcommunity/public/images/apps/440/e3f595a92552da3d664ad00277fad2107345f743.jpg" /></a></div>
                        </div>
                        <div class="eventBlockTitle"><a class="headlineLink" href="http://steamcommunity.com/groups/tf2scrap#events/1387405180685446058">Christmas Event!</a><br />
                            <span class="eventSmallText"></span>
                        <a href="http://steamcommunity.com/groups/tf2scrap#events/1387405180685446058">280 comments...</a>
                        </div>
                        <br clear="left" />
                    </div></expiredEvent>
        <eventCount>0</eventCount>
        <expiredEventCount>1</expiredEventCount></response>
    

    Or this for upcoming events:

    <response>
        <results>OK</results>
        <bPastMonth>0</bPastMonth>
        <monthName>January</monthName>
        <year>2014</year><event eventID="1371642583203021771">              <div class="eventBlock" id="1371642583203021771_eventBlock">
                    <div class="eventLeftBlock">&nbsp;</div>
                    <div class="eventDateBlock"><span class="">Friday 10</span><br /><span class="eventDateTime">11:00am</span></div>
                    <div class="eventBlockIcon">
                        <div class="playerAvatar"><a href="http://steamcommunity.com/groups/steamlug#events/1371642583203021771"><img src="http://cdn.steamcommunity.com/public/images/skin_1/eventIcon_ChatEvent.jpg" /></a></div>
                    </div>
                    <div class="eventBlockTitle"><a class="headlineLink" href="http://steamcommunity.com/groups/steamlug#events/1371642583203021771">SteamLUG Cast S02E01</a><br />
                        <span class="eventSmallText"></span>
                    <a href="http://steamcommunity.com/groups/steamlug#events/1371642583203021771">0 comments...</a>
                    </div>
                    <br clear="left" />
                </div></event>
        <eventCount>1</eventCount>
        <expiredEventCount>0</expiredEventCount>
    </response>
    

    event and expiredEvents can be in the same XML and the eventCount and expiredEventCount will reflect the total number of each that appear in the XML.

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

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog