Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as PHP by furizaa ( 17 years ago )
<?php

        //Get all needed includes
        require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ArmoryStream' . DIRECTORY_SEPARATOR . 'ArmoryStream.php';
        require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ArmoryStream' . DIRECTORY_SEPARATOR . 'Page' . DIRECTORY_SEPARATOR . 'Achievements.php';

        //Setup the StreamObject and tell it to use the european Armory data.
        //Also register the cache object
        $oClient = new ArmoryStream();
        $oClient->setLocation( ArmoryStream::LOCATION_EUROPE );

        //Setup the PageObject. Use the Achievement page and get FeastsOfStrength of a character
        $oCharacterPage = new ArmoryStream_Page_Achievements();
        $oCharacterPage->setCharacter('Nnoitra')
                ->setRealm('Gul'dan')
                ->setCategory( ArmoryStream_Page_Achievements::CATEGORY_FEASTSOFSTRENGTH );

        //Try to stream the ArmoryData into the AchievementPage object
        try {
                $oClient->streamIntoPage( $oCharacterPage );
        } catch ( Exception $oException ) {
                if ( $oException instanceof ArmoryStream_Page_Exception ) {
                        echo "Armory error: " . $oException->getArmoryMessage();
                }
                else {
                        echo "An error has occured: " . $oException->getMessage();
                }
                die();
        }

        //Write the FeastsOfStrength into the HTTP-Response
        echo "Nnoitra of Gul'dan<br />";
        foreach ( $oCharacterPage->Xml->category->achievement as $oAchievement ) {
                echo "
                        <img width='18px' height='18px' src='http://eu.wowarmory.com/wow-icons/_images/51x51/".$oAchievement['icon'].".jpg' />
                        ".$oAchievement['title']."<br />
                ";
        }

 

Revise this Paste

Children: 5402
Your Name: Code Language: