|
Posted: January 13, 2010, 05:55 PM |
|
<?php
require_once('./modules/phpDraw.class.php');
$img = new phpDraw(200, 120);
$img->add_color("greyish", 150,150,150);
$img->fill("black");
if(isset($_GET['name'])){
$name = $_GET['name'];
}
$raw_data = file_get_contents("http://steamcommunity.com/id/".$name."/games");
$ARRAY_DATA = preg_split('/<div class="gameLogo"><a href="(.*?)"><img src="/', $raw_data);
$DATA_TIME = explode("\n", $ARRAY_DATA[1]);
$times = str_replace(array("<h5>","</h5>"), "", $DATA_TIME[2]);
$new_time = explode("/", $times);
$link_arr = explode(" ", $ARRAY_DATA[1]);
$FULL_LINK = str_replace("\"", "", $link_arr[0]);
$img->copy_file($FULL_LINK);
$img->paste_file(8,5,0,0,184,69);
$img->text("greyish", 10, 80, 4, trim($new_time[0]));
$img->text("greyish", 10, 95, 4, trim($new_time[1]));
$img->output();
unset($DATA_TIME, $times, $raw_data, $ARRAY_DATA, $new_time, $img, $FULL_LINK);
?>