is it possible to take screenshots of webpages?
Moderator: General Moderators
is it possible to take screenshots of webpages?
is it possible to take screenshots of webpages? using php only like have a site take a pic of sitea every time it loads and displays a image of sitea
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Quick search brought up
viewtopic.php?t=36922&highlight=screenshot
viewtopic.php?t=33963&highlight=screenshot
viewtopic.php?t=36922&highlight=screenshot
viewtopic.php?t=33963&highlight=screenshot
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
From one of the threads I posted, timv posted this
If you are using *nix environment that is
Code: Select all
firefox http://example.com -display localhost:0 &
import -window root -display localhost:0 myfile01.pcx /home/user/website/screenshot.png
chmod o+r /home/user/website/screenshot.png@unsuaulvb:
Why don't you just use the code that I posted in the other thread? It retrieves the data from an XBox Live Card just fine. All you'd need to do is put it into a picture.
I've found a neat resource that shows you how to do exactly what you want to do:
http://www.ricocheting.com/perl/imgfly.html
It even gives you the code for it. But remember, no copy & paste...
Now, of course, you shouldn't forget about the PHP Manual:
http://php.net/gd
Oh, here's some more:
http://www.neowin.net/forum/index.php?showtopic=348463
You guessed it, I found this all in a matter of minutes with Google. Google is your friend!
Why don't you just use the code that I posted in the other thread? It retrieves the data from an XBox Live Card just fine. All you'd need to do is put it into a picture.
I've found a neat resource that shows you how to do exactly what you want to do:
http://www.ricocheting.com/perl/imgfly.html
It even gives you the code for it. But remember, no copy & paste...
Now, of course, you shouldn't forget about the PHP Manual:
http://php.net/gd
Oh, here's some more:
http://www.neowin.net/forum/index.php?showtopic=348463
You guessed it, I found this all in a matter of minutes with Google. Google is your friend!
i did use your code but some just like 2 things wasnt giving me the right info but thanks man you have been a huge help
but uh see ive been coding php mabye for a week and i really am not very good at it my code is always messy and over done, i can debug errors but for some reason i dont se any errors in my code but i get tons when i just try to test it
here it is
I also would like to state that i do know how to use GD properly

see ^^^^ lol
but uh see ive been coding php mabye for a week and i really am not very good at it my code is always messy and over done, i can debug errors but for some reason i dont se any errors in my code but i get tons when i just try to test it
here it is
Code: Select all
<?php
/* Define GamerTag */
if ( $_GET['gamertag'] == "" ) {
$gamertag = "No Gamertag";
} else {
$gamertag = $_GET['gamertag'];
}
/* Format Text */
$name = str_replace(" ", "%20", $gamertag);
$name = str_replace(".png", "", $name);
$name = str_replace(".jpg", "", $name);
$name = str_replace(".gif", "", $name);
$name = str_replace(".card", "", $name);
/* Open file - change path to suit your needs */
$fp = fopen("http://gamercard.xbox.com/$name.card", 'r');
/* Read the card file */
while ($tmp = fread($fp, 4096)) {
$file .= $tmp;
}
/* 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);
$avatar1 = $matches[1];
/* Match rep */
preg_match('@<img src="([^"]+)" />@', $file, $matches);
$rep = $matches[1];
/* Match score */
preg_match('@<span class="XbcFRAR">([\d]+)</span>@', $file, $matches);
$score1 = $matches[1];
/* Match zone */
preg_match('@<span class="XbcFRAR">([^<]+)</span>@', $file, $matches);
$zone1 = $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];
$games1 = $matches[2];
/* Define Rep Image */
if($rep=="http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_12.gif") {
$stars = "http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_12.gif";
} elseif($rep=="http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_13.gif") {
$stars = "http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_13.gif";
} elseif($rep=="http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_14.gif") {
$stars = "http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_14.gif";
} elseif($rep=="http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_15.gif") {
$stars = "http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_15.gif";
} elseif($rep=="http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_16.gif") {
$stars = "http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_16.gif";
} elseif($rep=="http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_17.gif") {
$stars = "src= http://gamercard.xbox.com/xweb/lib/imag ... nal_17.gif";
} elseif($rep=="http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_18.gif") {
$stars = "= http://gamercard.xbox.com/xweb/lib/imag ... nal_18.gif";
} elseif($rep=="http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_19.gif") {
$stars = "http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_19.gif";
} elseif($rep=="http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_20.gif") {
$stars = "http://gamercard.xbox.com/xweb/lib/images/gc_repstars_external_20.gif";
} else {
$stars = "";
/* Define BackGround */
$im = imagecreatefromgif("bg.gif");
/* Font Info */
$text = imagecolorallocate($im, 246, 246, 246);
$black = imagecolorallocate($im, 0, 0, 0);
$font = "X360.ttf"
/* Define Avatar */
$avatar1 = str_replace(".png", "", $avatar1)
$avatar1 = str_replace(".jpg", "", $avatar1);
$avatar1 = str_replace(".gif", "", $avatar1);
$avatar = imagecreatefromgif("$avatar1.jpg");
/* Define Gamerscore */
$score = "$score1";
/* Define Rep */
$stars = str_replace(".png", "", $stars);
$stars = str_replace(".jpg", "", $stars);
$stars = str_replace(".gif", "", $stars);
$rep = imagecreatefromgif("$stars.gif");
/* Define Games */
$games = "<img src= $games1>";
/* Define Zone */
$zone = "$zone1";
/* Define Text */
$zonetxt = "Zone";
$reptxt = "Rep";
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*Imagettftext (int im, int size, int angle, int x, int y, int col, string fontfile, string text)*/
Imagettftext($im, 1,0,3,3,$text,'$font',$zonetxt);
?>
see ^^^^ lol