Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-01-2006, 06:25 PM
NeedHelp NeedHelp is offline
Programming God
 
Join Date: May 2006
Posts: 527
Rep Power: 13
NeedHelp is on a distinguished road
Default Screenshots of website

How can I take screenshots of a website and display it? I see a lot of companies doing this now and they seem to be using PHP.

How can I do this?
__________________
I Need Help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 08-01-2006, 08:49 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,433
Last Blog:
Google Web Toolkit
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

so you want to like enter a url in a form and then use php to generate an image of the web site?

if so im looking forward to hearing some feedback, i will also need something like this in the future
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-02-2006, 10:18 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,203
Last Blog:
Ext JS or Ext GWT
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

In PHP, this is not possible.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-02-2006, 08:18 PM
DevilsCharm's Avatar   
DevilsCharm DevilsCharm is offline
Programming God
 
Join Date: Jul 2006
Posts: 887
Rep Power: 14
DevilsCharm is on a distinguished road
Default

There is a non-programming way to do this. Press PrintScreen on your keyboard, open up Paint or Photoshop, press Paste (right click > Paste, Edit > Paste, Cntrl + V, there are many ways to do it), size it to your link, save it, and then you can upload it to your site or wherever. Hope I helped.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-28-2006, 01:47 AM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,433
Last Blog:
Google Web Toolkit
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

found this in another forum

Quote:
Originally Posted by R4000
Grab yourself a copy of IECapt...
Then use this little script.

http://iecapt.sourceforge.net/


PHP Code:
<?php
/**
 * IECapt - PHP Frontend.
 * -
 * IECapt is a small application designed for screengrabbing websites
 * Using the Internet Explorer rendering engine.
 * -
 * This frontend is designed to allow people to enter URLs online
 * and be thrown a screenshot (resized to required dimensions) back
 * -
 * This code is COPYRIGHT (c) 2006, Peter Corcoran. ALL RIGHTS RESERVED.
 * ANY UNLICENSED USAGE WILL BE PUNISHED TO THE FULL EXTENT OF THE LAW.
 **/
 
?>
 <html>
  <head>
    <title>IECapt - Frontend</title>
    <style>
     * {
         font-family: verdana;
         font-size: 10px;
     }
    </style>
  </head>
  <body>
 <?php
/**
 * Okay, we will certainly go over the 30 second time limit.
 * So we need to get rid of it. UNLIMITED TIME!!! :P
 **/ 
set_time_limit(0);
/**
 * If we had a URL posted...
 **/
if($_POST['url']) {
    
/**
     * This URL is going to end up in the shell.
     * So we need to make it safe!
     **/
    
$f escapeshellcmd($_POST['url']);
    
/**
     * Notify the user that we are working on creating the thumbnail
     **/
    
echo "    Attempting to create thumb... Please wait<br />\n";
    
/**
     * Flush the output buffer.
     * -> This is for stupid browsers that won't display text till 100% loaded
     **/
    
flush();
    
/**
     * Lets start creating that thumbnail
     * -> This step takes a LONG time.
     **/
    
shell_exec("IECapt.exe \"" $f "\" " md5($f) . ".png");
    
/**
     * Okay, the max width was sent to us via _POST
     * and the max height doesn't exist, so make it big.
     **/
    
$maxw = (int)$_POST['maxw'];
    
$maxh 10000;
    
/**
     * We need to resize what the IECapt generated now...
     * -> So lets load it!
     **/
    
$im imagecreatefrompng(md5($f) . ".png");
    
/**
     * Lets find out how big the image, that IECapt got, is...
     **/
    
$w ImageSX($im);
    
$h ImageSY($im);
    
/**
     * Now resize that baby!
     * -> Thank you Alex Poole :)
     **/
    
list($image) = resizeImage($im$w$h$maxw$maxh);
    
/**
     * Resized... lets throw it back where it came from.
     **/
    
imagepng($imagemd5($f) . ".png");
    
/**
     * And let the user know we have finished.
     **/
    
echo "    Created!<br /><img src=\"" md5($f) . ".png\" />\n";
/**
 * End If
 **/
}

/**
 * Output HTML
 **/
?>
    <form actiom="thumb.php" method="POST">
      <table>
        <tr><td>URL to Thumb: </td><td><input type="text" name="url" />        </td></tr>
        <tr><td>Maximum Width:</td><td><input name="maxw" value="300" />       </td></tr>
        <tr><td>&nbsp;        </td><td><input type="submit" value="ThumbIT!" /></td></tr>
      </table>
    </form>
  </body>
</html>
<?php
/**
 * resizeImage
 * -
 * A small function by Alex Poole for resizing images
 **/
function resizeImage($image$iw$ih$maxw$maxh) {
    if (
$iw $maxw || $ih $maxh){
        if (
$iw>$maxw && $ih<=$maxh){
            
$proportion=($maxw*100)/$iw;
            
$neww=$maxw;
            
$newh=ceil(($ih*$proportion)/100);
        } else if (
$iw<=$maxw && $ih>$maxh){
            
$proportion=($maxh*100)/$ih;
            
$newh=$maxh;
            
$neww=ceil(($iw*$proportion)/100);
        } else {
            if (
$iw/$maxw $ih/$maxh){
                
$proportion=($maxw*100)/$iw;
                
$neww=$maxw;
                
$newh=ceil(($ih*$proportion)/100);
            } else {
                
$proportion=($maxh*100)/$ih;
                
$newh=$maxh;
                
$neww=ceil(($iw*$proportion)/100);
            }
        }
    } else {
        
$neww=$iw;
        
$newh=$ih;
    }
    if (
function_exists("imagecreatetruecolor")){
        
$newImage=imagecreatetruecolor($neww$newh);
        
imagecopyresampled($newImage$image0,0,0,0$neww$newh$iw$ih);
    } else {
        
$newImage=imagecreate($neww$newh);
        
imagecopyresized($newImage$image0,0,0,0$neww$newh$iw$ih);
    }
    return Array(
$newImage$neww$newh);
}
?>
Not sure how it works, and although it is for windows, it may be worth looking at.

Quote:
Originally Posted by wtf
You should check this out.

http://blog.joshuaeichorn.com/archiv...status-screen/

Here's the link to the app

http://bluga.net/webthumb/


You could easily write a script to send url and receive back the image. I believe he also has instructions on how he set it up.
I havnt read everything, but i guess the php would execute a C++ program on the server or something, i dunno, but it cannot be totally done using ONLY php.

Last edited by John; 08-28-2006 at 01:57 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 08-30-2006, 05:20 PM
getlies getlies is offline
Learning Programmer
 
Join Date: Aug 2006
Posts: 55
Rep Power: 9
getlies is on a distinguished road
Default

I find it much easier with the printscreen button :-)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 08-30-2006, 05:34 PM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 8,332
Rep Power: 68
TcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of lightTcM is a glorious beacon of light
Default

Yeah lol just Print Screen! rotfl why using all that code?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 08-31-2006, 04:47 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,433
Last Blog:
Google Web Toolkit
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

well why create a program for anything when you can do it manually?

it all depends on the time required to do the task manually. Sure if he wanted to only take 10 screenshots and display them, it wouldnt be worth the few hours it may take to create the program, but perhaps if he wants to make a web crawler to take a screenshot of every website and make a thumbnail in the same process i think it would be much better to create the program...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How 2 create a website tutorial mysticalone Website Design 3 02-02-2007 07:42 PM
Website Goodies littlefranciscan Website Design 1 01-15-2007 12:14 PM
Copying my website Chan Business and Legal 4 07-09-2006 08:27 PM
12 Website Design Decisions Your Business or Organization Will Need to Make Void Website Design 1 07-04-2006 09:42 PM


All times are GMT -5. The time now is 05:54 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 97%

Ads