![]()
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
<?php
$html = implode("\n", file("http://steamcommunity.com/id/lightpower777"));
$nam = explode('<title>Steam Community :: ID :: ', $html);
$nam = explode('</title>', $nam[1]);
$res1 = $nam[0];
$ges = explode('<div class="statsItemName">Playing time:</div>', $html);
$ges = explode(' hrs past 2 weeks', $ges[1]);
$res2 = $ges[0];
$img = explode('<div class="avatarHolder_default"><div class="avatarFull"><img src="', $html);
$img = explode('_full.jpg"', $img[1]);
$res3 = imagecreatefromjpeg($img[0].".jpg");
header("Content-type: image/png");
$im = @imagecreate(275, 42);
$background_color = imagecolorallocate($im, 58, 58, 58);
$text_color = imagecolorallocate($im, 111, 189, 255);
imagecopymerge($im, $res3, 5, 5, 0, 0, 32, 32, 100);
imagestring($im, 5, 42, 5, $res1, $text_color);
imagestring($im, 5, 42, 23, substr($res2, 8)." Stunden in 2 Wochen", $text_color);
imagepng($im);
imagedestroy($im);
imagedestroy($res3);
?>
|
Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von »@lex« (17. Januar 2010, 16:12)
Jedes mal wenn dann bei PC-Heaven die Signatur geladen wird werden auch die benötigten Werte neu ausgelesen.
Bisschen ineffizient, würde ja eigentlich reichen, wenn man die einmal am Tag ausliest oder? Spart eine Menge Zeit bei der Ausführung.

|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
<?
$name = $_GET['name'];
$xml = simplexml_load_file('http://steamcommunity.com/id/'.$name.'?xml=1');
header('Content-Type: image/png');
if($xml->onlineState == 'online')
{
$bg = imagecreatefromjpeg('img/online.jpg');
$text_color = imagecolorallocate($bg, 33, 124, 214);
}
else if($xml->onlineState == 'offline')
{
$bg = imagecreatefromjpeg('img/offline.jpg');
$text_color = imagecolorallocate($bg, 128, 128, 128);
}
else
{
$bg = imagecreatefromjpeg('img/ingame.jpg');
$text_color = imagecolorallocate($bg, 0, 181, 0);
}
imagecopymerge($bg, imagecreatefromjpeg($xml->avatarIcon), 8, 7, 0, 0, 32, 32, 100);
imagestring($bg, 2, 50, 5, $xml->steamID, $text_color);
imagestring($bg, 2, 50, 25, str_replace('<br />', ' - ', $xml->stateMessage), $text_color);
imagepng($bg, NULL, 0);
imagedestroy($bg);
imagedestroy($ava);
?>
|
Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von »@lex« (17. Januar 2010, 16:55)
Forensoftware: Burning Board® 3.1.7, entwickelt von WoltLab® GmbH
