<!-- STEAM --> <div class="block small_block" id="steam"> <div class="widget_header"> <div class="widget_name"><a target='_blank' href="http://steamcommunity.com/id/pinguu9999/">STEAM</a></div> <a href="http://steamcommunity.com/id/pinguu9999/"><?php $steam = jsonToArray("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?steamids=76561198067134270&key=", $config["STEAM"]["apikey"]); echo "<img class='profile_pic' src='" . $steam["response"]["players"][0]["avatarfull"] . "'>"; ?> </a> </div> <a href="http://steamcommunity.com/id/pinguu9999/"><h2><?php echo $steam["response"]["players"][0]["personaname"]; ?> </h2></a> </div>
<!-- YOUTUBE --> <div class="block small_block" id="youtube"> <div class="widget_header"> <div class="widget_name"><a target='_blank' href="https://www.youtube.com/channel/UCPEtpMuMht91_aJkmE_acZg">YOUTUBE</a></div> <a href="https://www.youtube.com/channel/UCPEtpMuMht91_aJkmE_acZg"><?php $youtube = jsonToArray("https://www.googleapis.com/youtube/v3/channels?part=snippet&id=UCPEtpMuMht91_aJkmE_acZg&key=", $config["YOUTUBE"]["apikey"]); echo "<img class='profile_pic' src='" . $youtube["items"][0]["snippet"]["thumbnails"]["default"]["url"] . "'>"; ?> </a> </div> <a href="https://www.youtube.com/channel/UCPEtpMuMht91_aJkmE_acZg"><h2><?php echo $youtube["items"][0]["snippet"]["title"]; ?> </h2></a> </div>
<!-- OSU --> <div class="block" id="osu"> <div class="widget_header"> <div class="widget_name"><a target='_blank' href="https://osu.ppy.sh/u/7197109">OSU</a></div> <a target='_blank' href="https://osu.ppy.sh/u/7197109"><img class="profile_pic" src="https://a.ppy.sh/7197109"></a> </div> <a target='_blank' href="https://osu.ppy.sh/u/7197109"><h2><?php $osu = jsonToArray("https://osu.ppy.sh/api/get_user?u=7197109&k=", $config["OSU"]["apikey"]); echo $osu[0]["username"]; ?> </h2></a> <div id="osu_preview"> <h3>#<?php echo $osu[0]["pp_rank"]; ?> </h3> <h3 id="country_rank"><img id="country_flag" src="../img/suomi.svg"> #<?php echo $osu[0]["pp_country_rank"]; ?> </h3> <span id="osu_stats"> Performance: <?php echo round($osu[0]["pp_raw"]); ?> pp <br>Accuracy: <?php echo round($osu[0]["accuracy"], 2, PHP_ROUND_HALF_UP); ?> % </br>
<!-- TUMBLR --> <div class="block" id="tumblr"> <div class="widget_header"> <div class="widget_name"><a target='_blank' href="http://ttypical.tumblr.com/">TUMBLR</a></div> <a target='_blank' href="http://ttypical.tumblr.com/"><img class="profile_pic" src="http://api.tumblr.com/v2/blog/ttypical.tumblr.com/avatar/128"></a> </div> <a target='_blank' href="http://ttypical.tumblr.com/"><h2><?php $tumblr = jsonToArray("https://api.tumblr.com/v2/blog/ttypical.tumblr.com/posts/photo?api_key=", $config["TUMBLR"]["consumerkey"]); echo $tumblr["response"]["blog"]["name"]; ?> </h2></a> <div class="images"><?php $i = 0; while ($i < 3) { $end = end($tumblr["response"]["posts"][$i]["photos"][0]["alt_sizes"]); echo "<a target='_blank' href='" . $tumblr["response"]["posts"][$i]["post_url"] . "'><img class='img' src='" . $end["url"] . "'></a>"; $i++; } ?> </div> </div>
<!-- TWITCH --> <div class="block" id="twitch"> <div class="widget_header"> <div class="widget_name"><a target='_blank' href="https://www.twitch.tv/lizardsn/profile">TWITCH</a></div> <a target='_blank' href="https://www.twitch.tv/lizardsn/profile"><?php $twitch = jsonToArray("https://api.twitch.tv/kraken/users/lizardsn"); echo "<img class='profile_pic' src='" . $twitch["logo"] . "'>"; ?> </a> </div> <a target='_blank' href="https://www.twitch.tv/lizardsn/profile"><h2><?php echo $twitch["name"]; ?> </h2></a> <div class="images"><?php $twitchFollows = jsonToArray("https://api.twitch.tv/kraken/users/lizardsn/follows/channels"); $t = 0; while ($t < 12) { echo "<a target='_blank' href='" . $twitchFollows["follows"][$t]["channel"]["url"] . "'><img class='tiny_img' src='" . $twitchFollows["follows"][$t]["channel"]["logo"] . "'></a>"; $t++; } ?> </div> </div>
<!-- INSTAGRAM --> <div class="block" id="instagram"> <div class="widget_header"> <div class="widget_name"><a target='_blank' href="https://www.instagram.com/santerinogelainen/">INSTAGRAM</a></div> <?php $igUser = jsonToArray("https://api.instagram.com/v1/users/self/?access_token=", $config["IG"]["IGtoken"]); echo "<a target='_blank' href='https://www.instagram.com/santerinogelainen/'><img class='profile_pic' src='" . $igUser["data"]["profile_picture"] . "'></a>"; ?> </div><a target='_blank' href="https://www.instagram.com/santerinogelainen/"><h2><?php echo $igUser["data"]["username"]; ?> </h2></a><div class="images"><?php getIGPictures(3); ?> </div> </div>
<!-- SOUNDCLOUD --> <div class="block small_block" id="soundcloud"> <div class="widget_header"> <div class="widget_name"><a target='_blank' href="https://soundcloud.com/pinguu9999">SOUNDCLOUD</a></div> <a href="https://soundcloud.com/pinguu9999"><?php $soundcloud = jsonToArray("http://api.soundcloud.com/users/124475820?client_id=", $config["SOUNDCLOUD"]["clientid"]); echo "<img class='profile_pic' src='" . $soundcloud["avatar_url"] . "'>"; ?> </a> </div> <a href="https://soundcloud.com/pinguu9999"><h2><?php echo $soundcloud["username"]; ?> </h2></a> </div>
/** * Json object to array * * @param object $json * @return array */ function jsonToArray($json) { $array = []; foreach ($json as $key => $val) { $array[$key] = is_object($val) ? jsonToArray($val) : $val; } return $array; }
<div class="block" id="lastfm"> <div class="widget_header"> <div class="widget_name"><a target='_blank' href="http://www.last.fm/user/pinguu9999">LAST.FM</a></div> <a target='_blank' href="http://www.last.fm/user/pinguu9999"><?php $lastfmUser = jsonToArray("http://ws.audioscrobbler.com/2.0/?method=user.getinfo&user=pinguu9999&format=json&api_key=", $config["LASTFM"]["apikey"]); echo "<img class='profile_pic' src='" . $lastfmUser["user"]["image"][2]["#text"] . "'>"; ?> </a> </div> <a target='_blank' href="http://www.last.fm/user/pinguu9999"><h2><?php echo $lastfmUser["user"]["name"]; ?> </h2></a> <div class="preview"> <table><?php $lastTracks = jsonToArray("http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=pinguu9999&limit=5&format=json&api_key=", $config["LASTFM"]["apikey"], false); $last = 0; while ($last < 5) { echo "<tr><td>"; echo $lastTracks->recenttracks->track[$last]->artist->{"#text"} . " - " . $lastTracks->recenttracks->track[$last]->name; echo "</td><td>"; if (property_exists($lastTracks->recenttracks->track[$last], "date")) { echo $lastTracks->recenttracks->track[$last]->date->{"#text"}; } else { echo "♫Now Playing♫"; } echo "</td></tr>"; $last++; } ?> </table>