diff --git a/cronjobs/index_data.php b/cronjobs/index_data.php index ec9a4df..7dc86a6 100644 --- a/cronjobs/index_data.php +++ b/cronjobs/index_data.php @@ -25,11 +25,11 @@ define('LOCK',$conf->site->path . '/data/whoisandrew.lock'); $dataSources = array( 'twitter' => 300, 'github' => 300, - 'hulu' => 600, 'lastfm' => 60, // 'sc2ranks' => 43200, 'steam' => 3600, - 'wow' => 43200, + 'wow' => 43200, + 'diablo' => 43200, ); // Make sure that the script does not begin execution if it is already. @@ -239,11 +239,33 @@ function steam() { } } +function diablo() { + $url = 'http://us.battle.net//api/d3/profile/Tomaka-1761/'; + $career = json_decode(curl_request($url)); + + // cheat and just use information from barbarian + $barb = $career->heroes[0]; + + $data = array( + 'hardcoreFails' => (int)count($career->fallenHeroes), + 'highestParagon' => (int)$barb->paragonLevel, + 'monsters' => (int)$career->kills->monsters, + 'elites' => (int)$career->kills->elites, + 'hardcoreMonsters'=> (int)$career->kills->hardcoreMonsters, + ); + + if(isset($data['hardcoreFails'])&&isset($data['highestParagon'])&&isset($data['monsters'])&&isset($data['elites'])&&isset($data['hardcoreMonsters'])) { + return $data; + } else { + return false; + } +} + function wow() { $CLASSES = array( 6 => 'deathknight', 5 => 'priest', - 11 => 'druid', + 11 => 'druid', 4 => 'rogue', 8 => 'mage', 7 => 'shaman', @@ -253,12 +275,12 @@ function wow() { ); $characters = array( - 'Gaffer' => false, + 'Gaffer' => false, 'Getburnt' => false, 'Veincane' => false, - 'Toppazz' => false, - 'Toopro' => false, - 'Levita' => false, + 'Toppazz' => false, + 'Toopro' => false, + 'Levita' => false, 'Trinikwan' => false, 'Notgaffer' => false, 'Loveglove' => false, diff --git a/public_html/img/badges/diablo3.png b/public_html/img/badges/diablo3.png new file mode 100644 index 0000000..7935e97 Binary files /dev/null and b/public_html/img/badges/diablo3.png differ diff --git a/public_html/img/d3/barbarian.jpg b/public_html/img/d3/barbarian.jpg new file mode 100644 index 0000000..55bbebc Binary files /dev/null and b/public_html/img/d3/barbarian.jpg differ diff --git a/public_html/index.php b/public_html/index.php index 1009838..f968f16 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -47,10 +47,10 @@ $links = $db->query("SELECT id,url,text,status,released_date FROM wia_links WHER
-

projects

+ - + + -->

random

@@ -97,7 +97,7 @@ while($link = $links->fetch_object()) {
-
+

games

World of Warcraft

@@ -140,7 +140,21 @@ foreach($data->wow as $character) {
+

Diablo 3

Starcraft 2

+
+ + + + + + +
Diablo 3 + Tomaka#1761
+ Paragon: diablo->highestParagon ?>
+ Elite Kills: diablo->elites ?> +
<?php echo ucfirst($data->sc2ranks->league) ?> League
+