Website snapshots?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Website snapshots?

Post by JellyFish »

You know how on alexa.com and ask.com they have snapshot/previews images of websites. For example on alexa.com you see all the little thumbnails of the web addresses?

Could this be done in php on the server? Or will I need to use some executable on my server or something? How is this usually done?

Thanks for reading.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Website snapshots?

Post by Christopher »

There are some ActiveX components that will do this on windows and a plugin for firefox. If you could run it through a browser on the command line that would probably be the fastest renderer. There may also be utilities that do this.
(#10850)
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Re: Website snapshots?

Post by JellyFish »

arborint wrote:There are some ActiveX components that will do this on windows and a plugin for firefox. If you could run it through a browser on the command line that would probably be the fastest renderer. There may also be utilities that do this.
There wouldn't be a way to do this in scripting would there? That is maybe a php library or something of that nature?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: Website snapshots?

Post by Luke »

Rendering an entire website (basically a browser) is definitely beyond the scope of a php script. There are services that provide an API for it though.
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Re: Website snapshots?

Post by JellyFish »

The Ninja Space Goat wrote:Rendering an entire website (basically a browser) is definitely beyond the scope of a php script. There are services that provide an API for it though.
I see. Would you happen to know the name of the sevices. Also what is 'this' called by the way?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: Website snapshots?

Post by Luke »

User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: Website snapshots?

Post by Zoxive »

http://lists.nyphp.org/pipermail/talk/2 ... 20039.html
A better solution is to use Firefox:

1. Run Xvfb instead of a real X server so that you don't need to attach to a monitor.
2. Run firefox supplying the URL as a command-line parm.
3. Run xwininfo to find the proper root window.
4. Run import from imagemagick to get an image of that window.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: Website snapshots?

Post by Luke »

nice... that's a cool solution. JellyFish, I'd go what what Zoxive said.
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Re: Website snapshots?

Post by JellyFish »

I'm not quite sure I'm familiar with everything Zoxive said. But I'm starting to wonder if any of this would work on a shared hosted server?
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: Website snapshots?

Post by Zoxive »

JellyFish wrote:I'm not quite sure I'm familiar with everything Zoxive said. But I'm starting to wonder if any of this would work on a shared hosted server?
Nope, because they won't even have Firefox installed.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Website snapshots?

Post by Chris Corbyn »

I'd say OS X's WebKit can do this. Not 100% though, but it's the engine which powers safari and the dock etc.
Post Reply