All pastes #897451 Raw Edit

Stuff

public text v1 · immutable
·published 2008-02-09 15:57 UTC
rendered paste body
        function get_snapshot_data ($gamertag) {
            
            /*
            ** Function: get_snapshot_data
            ** Description: Get's a player's data from their player snapshot.
            ** Param $gamertag STRING The user's gamertag.
            ** Author: Clooth
            */

            $username = urlencode( $gamertag );
            $source = $this->curl("http://www.bungie.net/stats/halo3/default.aspx?player={$username}");
            $source = $this->get_between('<table class="profile_strip_tableB" style="float:left;">', '<div class="clear"></div>', $source);
            $source = explode("\n", $source);
            
            $info = array();
            for( $i = 0; $i<count($source); $i++ )
            {
                if( stristr($source[$i], '<td>') )
                {
                    $current = $this->get_between('<td>', '</td>', $source[$i]);
                    $info[$current] = $this->get_between('<td class="values">', '</td>', $source[$i+1]);
                }
                else { continue; }
            }

            return $output;

        }