Code: Select all
$path = "http://gamercard.xbox.com/$name.card";Moderator: General Moderators
Code: Select all
$path = "http://gamercard.xbox.com/$name.card";Now we're talking! This is the kind of information you should have mentioned straight off the bat!unsuaulvb wrote:thing is thatisnt a image but a html document will it still workCode: Select all
$path = "http://gamercard.xbox.com/$name.card";
Code: Select all
<?php
/* Open file - change path to suit your needs */
$fp = fopen('unusualvb.card', 'r');
/* Read the card file */
while ($tmp = fread($fp, 4096)) {
$file .= $tmp;
}
/* ---Let's do the Regex dance...--- */
/* Match nick */
preg_match('@<span class="XbcFLAL">([^<]+)</span>@', $file, $matches);
$name = $matches[1];
/* Match avatar */
preg_match('@<img class="XbcgcGamertile" height="64" width="64" src="([^"]+)" />@', $file, $matches);
$avatar = $matches[1];
/* Match rep */
preg_match('@<img src="([^"]+)" />@', $file, $matches);
$rep = $matches[1];
/* Match score */
preg_match('@<span class="XbcFRAR">([\d]+)</span>@', $file, $matches);
$score = $matches[1];
/* Match zone */
preg_match('@<span class="XbcFRAR">([^<]+)</span>@', $file, $matches);
$zone = $matches[1];
/* Match game links */
preg_match_all('@<a href="(http\:\/\/live\.xbox\.com\/[\w]+-[\w]+\/profile\/Achievements\/ViewAchievementDetails\.aspx\?compareTo\=[^"]+)">@', $file, $matches);
$links = $matches[1];
/* Match game titles & icons */
preg_match_all('@<img height\="32" width\="32" title\="([^"]+)" alt\="" src="(http\:\/\/tiles\.xbox\.com\/tiles\/[\w]{2}\/[\w]{2}\/[^=]+\=\.jpg)" />@', $file, $matches);
$titles = $matches[1];
$images = $matches[2];
?>Code: Select all
/* Open file - change path to suit your needs */
$fp = fopen('unusualvb.card', 'r');
/* Read the card file */
while ($tmp = fread($fp, 4096)) {
$file .= $tmp;
}
/* ---Let's do the Regex dance...--- */
/* Match nick */
preg_match('@<span class="XbcFLAL">([^<]+)</span>@', $file, $matches);
$name = $matches[1];
/* Match avatar */
preg_match('@<img class="XbcgcGamertile" height="64" width="64" src="([^"]+)" />@', $file, $matches);
$avatar = $matches[1];
/* Match rep */
preg_match('@<img src="([^"]+)" />@', $file, $matches);
$rep = $matches[1];
/* Match score */
preg_match('@<span class="XbcFRAR">([\d]+)</span>@', $file, $matches);
$score = $matches[1];
/* Match zone */
preg_match('@<span class="XbcFRAR">([^<]+)</span>@', $file, $matches);
$zone = $matches[1];
/* Match game links */
preg_match_all('@<a href="(http\:\/\/live\.xbox\.com\/[\w]+-[\w]+\/profile\/Achievements\/ViewAchievementDetails\.aspx\?compareTo\=[^"]+)">@', $file, $matches);
$links = $matches[1];
/* Match game titles & icons */
preg_match_all('@<img height\="32" width\="32" title\="([^"]+)" alt\="" src="(http\:\/\/tiles\.xbox\.com\/tiles\/[\w]{2}\/[\w]{2}\/[^=]+\=\.jpg)" />@', $file, $matches);
$titles = $matches[1];
$images = $matches[2];Code: Select all
<?php
$im = ImageCreate(204, 104);
$bg = imagecolorallocate($im, 0, 0, 0);
$fontcolor = imagecolorallocate($im, 255, 255, 522);
$path = "http://gamercard.xbox.com/$name.card";
if ( $_GET['gamertag'] == "" ) {
$gamertag = "No Gamertag";
} else {
$gamertag = $_GET['gamertag'];
}
////////////////////////////////////
$str = "$gamertag";
$name = str_replace(" ", "%20", $str);
$name = str_replace(".png", "", $name);
$name = str_replace(".jpg", "", $name);
$name = str_replace(".gif", "", $name);
////////////////////////////////////
ImageString ($im, 0, 0, 0, "echo <iframe src= http://gamercard.xbox.com/$name.card scrolling=no frameBorder=0 height=140</iframe>", $fontcolor);
////////////////////////////////////
Header('Content-type: image/png');
imagepng($im);
ImageDestroy ($im);
?>