Announcement

Collapse

Forum Rules

  • No flaming or derogatory remarks, directly or through insinuation.
  • No discussion, sharing or referencing illegal software such as hacks, keygen, cracks and pirated software.
  • No offensive contents, including but not limited to, racism, gore or pornography.
  • No excessive spam/meme, i.e. copious one liners in a short period of time, typing with all caps or posting meme responses (text/image).
  • No trolling, including but not limited to, flame incitation, user provocation or false information distribution.
  • No link spamming or signature advertisements for content not specific to Dota 2.
  • No Dota 2 key requests, sell, trade etc.
  • You may not create multiple accounts for any purpose, including ban evasion, unless expressly permitted by a moderator.

  • Please search before posting. One thread per issue. Do not create another thread if there is an existing one already.
  • Before posting anything, make sure you check out all sticky threads (e.g., this). Do not create new threads about closed ones.
  • It is extremely important that you post in correct forum section.

  • Balance discussion only in Misc.
  • All art related (such as hero model) feedbacks go to Art Feedback Forum.
  • All matchmaking feedback should go here: Matchmaking Feedback
  • All report/low priority issues should go here: Commend/Report/Ban Feedback
  • No specific workshop item feedback. These should go to workshop page of that item.
  • When posting in non-bugs section (such as this), use [Bugs], [Discussion] or [Suggestion] prefix in your thread name.



In case you object some action by a moderator, please contact him directly through PM and explain your concerns politely. If you are still unable to resolve the issue, contact an administrator. Do not drag these issues in public.



All rules are meant to augment common sense, please use them when not conflicted with aforementioned policies.
See more
See less

Another way for API processing with PHP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Ahh, thanks.
    But it is not working yet.

    test.php =
    <?php
    require_once ('config.php');
    $mm = new match_mapper_web(121995119);
    $match = $mm->load();
    echo $match->get('match_id');
    echo $match->get('start_time');
    echo $match->get('game_mode');
    $slots = $match->get_all_slots();
    foreach($slots as $slot) {
    echo $slot->get('last_hits');
    }
    print_r($match->get_data_array());
    print_r($match->get_slot(0)->get_data_array());
    ?>
    and I'm getting this =
    Warning: It is not yet possible to assign complex types to attributes in C:\Program Files\EasyPHP-12.1\www\api\dota2-api-master\includes\mappers\class.match_mapper_web.php on line 62

    Warning: It is not yet possible to assign complex types to attributes in C:\Program Files\EasyPHP-12.1\www\api\dota2-api-master\includes\mappers\class.match_mapper_web.php on line 62

    Warning: It is not yet possible to assign complex types to attributes in C:\Program Files\EasyPHP-12.1\www\api\dota2-api-master\includes\mappers\class.match_mapper_web.php on line 62
    1219951192013-02-10 17:44:04410753303181Array ( [match_id] => 121995119 [season] => 7 [radiant_win] => 1 [duration] => 251 [first_blood_time] => 138 [start_time] => 2013-02-10 17:44:04 [match_seq_num] => 112119348 [game_mode] => 4 [tower_status_radiant] => 2047 [tower_status_dire] => 2047 [barracks_status_radiant] => 63 [barracks_status_dire] => 63 [replay_salt] => [lobby_type] => 0 [human_players] => 10 [leagueid] => 0 [cluster] => 132 [positive_votes] => 0 [negative_votes] => 0 [radiant_team_id] => [radiant_name] => [radiant_logo] => [radiant_team_complete] => [dire_team_id] => [dire_name] => [dire_logo] => [dire_team_complete] => ) Array ( [id] => [account_id] => 4294967295 [player_slot] => 0 [hero_id] => 59 [item_0] => 25 [item_1] => 29 [item_2] => 0 [item_3] => 0 [item_4] => 0 [item_5] => 0 [kills] => 1 [deaths] => 0 [assists] => 0 [leaver_status] => 0 [gold] => 559 [last_hits] => 10 [denies] => 0 [gold_per_min] => 248 [xp_per_min] => 401 [gold_spent] => 1085 [hero_damage] => 603 [tower_damage] => 0 [hero_healing] => 0 [level] => 5 [match_id] => 121995119 )
    What can be wrong? I tried everything.

    Comment


    • #17
      Jarolim, just turn off error reporting.
      In your case you just got few warnings. All works.

      DotA 2 Web API Processing with PHP
      DotA2 Statistic - Professional leagues statistic
      follow @dota2statistic

      Comment


      • #18
        Topic up.
        Fixed league listing issue.

        DotA 2 Web API Processing with PHP
        DotA2 Statistic - Professional leagues statistic
        follow @dota2statistic

        Comment


        • #19
          With your API as I can get the nicknames of the players? because it brings the ID of the participating players a game

          Comment


          • #20
            Dipri, https://github.com/kronusme/dota2-api#get-player-info
            To get steamId use player::convert_id (https://github.com/kronusme/dota2-ap...player.php#L79).

            DotA 2 Web API Processing with PHP
            DotA2 Statistic - Professional leagues statistic
            follow @dota2statistic

            Comment


            • #21
              If you use https://github.com/kronusme/dota2-api on your site and are interested to populate it - give me link (in this thread or PM) and I'll put it to ReadMe on the GitHub.

              DotA 2 Web API Processing with PHP
              DotA2 Statistic - Professional leagues statistic
              follow @dota2statistic

              Comment


              • #22
                https://github.com/kronusme/dota2-api - updates, bugs fixes etc.

                DotA 2 Web API Processing with PHP
                DotA2 Statistic - Professional leagues statistic
                follow @dota2statistic

                Comment


                • #23
                  Private Match not work get results?

                  Comment


                  • #24
                    Originally posted by budswarez View Post
                    Private Match not work get results?
                    You cannot get data on private matches through the WebAPI.

                    Comment


                    • #25
                      HI all, Gelios I can not make it work
                      I did everything written in the readme... but tests.php doesn't work for me.
                      my DB is empty, and remains empty even after uploading tests.php

                      What information can I write to understand where is the problem?

                      tnx a lot, and congrats for your hard work

                      Comment


                      • #26
                        Originally posted by jaffarbp View Post
                        Just wanted to say that you have done an awesome job! To anyone using the api just a quick tip that i somehow missed -> since you have been limited to getting up to 25 matches per request when requesting the next 25 get the oldest match id from database and search from it. Example would be ($oldest = oldest id)
                        can you write a full example? tnx you man

                        Comment


                        • #27
                          Any questions/enhancement?

                          DotA 2 Web API Processing with PHP
                          DotA2 Statistic - Professional leagues statistic
                          follow @dota2statistic

                          Comment


                          • #28
                            hi I need help... when I try to test... the page is always loading and doesn't show anything... i enabled the cUrl extension... and i open myPhpAdmin and create table 'dota2' then import all the sql u given then edit config file and changed define ('API_KEY', '*******************'); into ('API_KEY', '79CE3A1493D7202048BA864171197C0C'); or am I doing it wrong...

                            Comment


                            • #29
                              JeraldPunx11, did you change DB host, DB name, DB user?

                              DotA 2 Web API Processing with PHP
                              DotA2 Statistic - Professional leagues statistic
                              follow @dota2statistic

                              Comment


                              • #30
                                Small article about statistic - http://kronus.me/2013/08/dota2-api-h...c-ti3-matches/.
                                There you can find dump with TI3 matches.

                                DotA 2 Web API Processing with PHP
                                DotA2 Statistic - Professional leagues statistic
                                follow @dota2statistic

                                Comment

                                Working...
                                X