Ejemplo n.º 1
0
                </ul>
            </section>
            <h1 id="lib"><a href="http://coss.github.com/bnetlib" title="End User Documentation">bnetlib</a></h1>
    </header>
    <section>
        <section>
            <article>
                <div class="inner">
                    <h1>Auction Demo</h1>
                    <?php 
use bnetlib\Locale\Locale;
use bnetlib\Connection\Stub;
use bnetlib\WorldOfWarcraft;
use bnetlib\Resource\Entity\Wow\Auction\Faction;
$locale = new Locale(Stub::LOCALE_GB, WorldOfWarcraft::SHORT_NAME);
$wow = new WorldOfWarcraft(new Stub());
$wow->getConnection()->setOptions(array('defaults' => array('region' => Stub::REGION_EU)));
$wow->getServiceLocator()->setLocale($locale);
$auction = $wow->getAuction(array('realm' => 'Die ewige Wacht'));
$auctionData = $wow->getAuctionData($auction);
foreach (array(0 => 'getAlliance', 1 => 'getHorde') as $id => $method) {
    printf('<h2>%s</h2>', $locale->get('faction.' . $id));
    /* @var $faction Faction */
    $faction = call_user_func(array($auctionData, $method));
    $ruby = $faction->getByItem(52986);
    if (empty($ruby)) {
        echo '<p>No "Heartblossom" listed.</p>';
    } else {
        printf('<p>Found <strong>%d</strong> entries for "Heartblossom". ' . 'The duration for <strong>%d</strong> auctions is "Short".</p>', count($ruby), count($faction->getItemAndTimeIntersection(52177, Faction::TIME_SHORT)));
        echo '<table><thead><tr><th>Auction Id</th><th>Quantity</th><th>Owner</th>';
        echo '<th>Bid</th><th>Buyout</th><th>Duration</th></tr></thead><tbody>';
Ejemplo n.º 2
0
                    <li><a href="https://github.com/coss/bnetlib/issues" title="Report an Issue">Issues</a></li>
                </ul>
            </section>
            <h1 id="lib"><a href="http://coss.github.com/bnetlib" title="End User Documentation">bnetlib</a></h1>
    </header>
    <section>
        <section>
            <article>
                <div class="inner">
                    <h1>Arena Ladder and Team Demo</h1>
                    <?php 
use bnetlib\Locale\Locale;
use bnetlib\Connection\Stub;
use bnetlib\WorldOfWarcraft;
$locale = new Locale(Stub::LOCALE_GB, WorldOfWarcraft::SHORT_NAME);
$wow = new WorldOfWarcraft(new Stub());
$wow->getConnection()->setOptions(array('defaults' => array('region' => Stub::REGION_EU)));
$wow->getServiceLocator()->setLocale($locale);
$ladder = $wow->getArenaLadder(array('battlegroup' => 'Cataclysme / Cataclysm', 'teamsize' => '2v2'));
foreach ($ladder as $entry) {
    printf('<h2>#%d %s</h2>', $entry->getRanking(), $entry->getName());
    echo '<table><thead><tr><th>Key</th><th>Value</th></tr></thead><tbody>';
    echo '<tr>';
    echo '<td>Size</td>';
    printf('<td>%s</td>', $entry->getSize());
    echo '</tr><tr>';
    echo '<td>Realm</td>';
    printf('<td>%s</td>', $entry->getRealm());
    echo '</tr><tr>';
    echo '<td>Faction</td>';
    printf('<td>%s</td>', $entry->getFactionLocale());
Ejemplo n.º 3
0
                    <li><a href="https://github.com/coss/bnetlib/issues" title="Report an Issue">Issues</a></li>
                </ul>
            </section>
            <h1 id="lib"><a href="http://coss.github.com/bnetlib" title="End User Documentation">bnetlib</a></h1>
    </header>
    <section>
        <section>
            <article>
                <div class="inner">
                    <h1>Achievements Demo</h1>
                    <?php 
use bnetlib\Locale\Locale;
use bnetlib\Connection\Stub;
use bnetlib\WorldOfWarcraft;
$locale = new Locale(Stub::LOCALE_GB, WorldOfWarcraft::SHORT_NAME);
$wow = new WorldOfWarcraft(new Stub());
$wow->getConnection()->setOptions(array('defaults' => array('region' => Stub::REGION_EU)));
$wow->getServiceLocator()->setLocale($locale);
$achievement = $wow->getAchievement(array('id' => 12345));
$achievementData = $wow->getCharacterAchievements();
printf('<h2>%s</h2>', $achievement->getName());
echo '<table><thead><tr><th>Key</th><th>Value</th></tr></thead><tbody>';
$criteriaString = '<table><thead><tr><th>Id</th><th>Description</th></tr></thead><tbody>';
foreach ($achievement->getCriteria() as $criteria) {
    $criteriaString .= sprintf('<tr><td>%d</td><td>%s</td></tr>', $criteria->getId(), $criteria->getDescription());
}
$criteriaString .= '</tbody></table>';
if ($achievement->hasRewardItems()) {
    $rewardString = '<table><thead><tr><th>Key</th><th>Value</th></tr></thead><tbody>';
    foreach ($achievement->getRewardItems() as $item) {
        $rewardString .= sprintf('<tr><td>Id</td><td>%d</td></tr>', $item->getId());
Ejemplo n.º 4
0
                </ul>
            </section>
            <h1 id="lib"><a href="http://coss.github.com/bnetlib" title="End User Documentation">bnetlib</a></h1>
    </header>
    <section>
        <section>
            <article>
                <div class="inner">
                    <h1>Battlegroup and Realms Demo</h1>
                    <?php 
use bnetlib\Locale\Locale;
use bnetlib\Connection\Stub;
use bnetlib\WorldOfWarcraft;
use bnetlib\Resource\Entity\Wow\Realms;
$locale = new Locale(Stub::LOCALE_GB, WorldOfWarcraft::SHORT_NAME);
$wow = new WorldOfWarcraft(new Stub());
$wow->getConnection()->setOptions(array('defaults' => array('region' => Stub::REGION_EU)));
$wow->getServiceLocator()->setLocale($locale);
$realms = $wow->getRealms();
$battlegroups = $wow->getBattlegroups();
echo '<h2>Battlegroups</h2>';
echo '<table><thead><tr><th class="center">Realms</th><th>Name</th><th>Slug</th></tr></thead><tbody>';
$bgList = array();
foreach ($battlegroups as $battlegroup) {
    $realmCount = count($realms->getByBattlegroup($battlegroup->getName()));
    if ($realmCount > 0) {
        $bgList[] = $battlegroup;
    }
    echo '<tr>';
    printf('<td class="center">%d</td>', $realmCount);
    printf('<td>%s</td>', $battlegroup->getName());
Ejemplo n.º 5
0
                </ul>
            </section>
            <h1 id="lib"><a href="http://coss.github.com/bnetlib" title="End User Documentation">bnetlib</a></h1>
    </header>
    <section>
        <section>
            <article>
                <div class="inner">
                    <h1>Character and Guild Demo</h1>
                    <?php 
use bnetlib\Locale\Locale;
use bnetlib\Connection\Stub;
use bnetlib\WorldOfWarcraft;
use bnetlib\Resource\Entity\Wow\Guild\News;
$locale = new Locale(Stub::LOCALE_GB, WorldOfWarcraft::SHORT_NAME);
$wow = new WorldOfWarcraft(new Stub());
$wow->getConnection()->setOptions(array('defaults' => array('region' => Stub::REGION_EU)));
$wow->getServiceLocator()->setLocale($locale);
$guild = $wow->getGuild(array('realm' => 'Blackrock', 'name' => 'Roots of Dragonmaw'));
$char = $wow->getCharacter(array('realm' => 'Blackrock', 'name' => 'Coss', 'fields' => array('guild', 'talents', 'reputation', 'titles', 'professions')));
$tbn = $wow->getThumbnail($char);
printf('<h2><img src="data:image/jpeg;base64,%s" height="26" wight="26"> %s</h2>', base64_encode($tbn->getData()), $char->getFullName());
echo '<table><thead><tr><th>Key</th><th>Value</th></tr></thead><tbody>';
echo '<tr>';
echo '<td>Name</td>';
printf('<td>%s</td>', $char->getName());
echo '</tr><tr>';
echo '<td>Realm</td>';
printf('<td>%s</td>', $char->getRealm());
echo '</tr><tr>';
echo '<td>Level</td>';