Website picture from PHP

This is a discussion on Website picture from PHP within the PHP Language forums, part of the PHP Programming Forums category; William Maddler wrote: > 0000=year wrote: > > > mumble... ok... it is not done with PHP... but I ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 01-25-2005
kicken
 
Posts: n/a
Default Re: Website picture from PHP

William Maddler wrote:
> 0000=year wrote:
>
>
> mumble... ok... it is not done with PHP... but I think this could help...
> there is a command (can't recall it's name right now) which allows you to
> capture an X screenshot from the command line. Basically what you need to
> to is a file (or a SQL table) containing all the URLs to be "shooted". Then
> have them opened with Firefox (using the '-remote "openurl()"' function)
> and the script to capture the screen. Once the capture is done you can load
> the next site.
>
> The only part missing is the name of the proggie to do the screenshot from
> the console. I am 101% sure it exists...
>
> hope it helps... or drop me a line... I'll be happy to help...
>


(I used mozilla, but I think it would apply for firefox too)

I wrote something like this, but there are numerous problems with this
setup. The first being that some sites may open new windows, or
javascript alerts. The alerts will prevent mozilla from listening to
the -remote command. This could be prevented by disabling javascript,
but that could cause other problems with rendering. Probably wouldn't
be too bad though.

Second, it can take a long time to know when a URL has been loaded.
Basically you just have to say "Wait x number of seconds and then
shoot." The problem with this is that if the site loads fast, you waste
time waiting for nothing. If the site is really slow, you end up taking
a picture of nothing, or taking a picture when it's only partially loaded.

Finally, any internal browser errors will result in a blank picture.
Either one of just the alert throw up, or the desktop background.

The code I wrote, I let people use, and I described how to get it
running, which was a chore in and of itself because you had to install
everything required by firefox, like X and gtk and libIDL, etc. The
code is long gone now because of a server-crash, but it was horribly
slow and very prone to the faults above. The ideal method of doing this
would to be create a custom application using gecko which will render to
a file. I though about this at the time too, but I don't have the
skill, nor the time to look at even starting to do this. I have seen a
few commercial products that will render a website to a .jpg, but I
forget the name of them now.

For what it's worth, the program you were trying to recall that takes a
screen shot is the 'import' command, provided by Image Magick.

'import -window root -quality 85 url.jpg' That's the basic command I
used. I included the scaleing information as well, but I forgot the
flags to do that by now.
Reply With Quote
  #12 (permalink)  
Old 01-25-2005
JDS
 
Posts: n/a
Default Re: Website picture from PHP

On Sun, 23 Jan 2005 19:47:36 +0100, Mathias wrote:

> As PHP is a server side programming language it is impossible to make
> screenshots of the client screen with it! Sorry, but i guess you have to
> take the screenshots on your own. ;-)


What if you have a headless rendering engine on your server that can
output data to a file instead of the screen?

--
JDS | jeffrey@go.away.com
| http://www.newtnotes.com

Reply With Quote
  #13 (permalink)  
Old 01-26-2005
R. Rajesh Jeba Anbiah
 
Posts: n/a
Default [OT]Re: Website picture from PHP

kicken wrote:
<snip>
> (I used mozilla, but I think it would apply for firefox too)

<snip>

I bookmarked and saved your code sometimes ago. But, I see the links
are now dead. IMHO, if they're up, you may get some feedbacks and
suggestions to improve that code.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Reply With Quote
  #14 (permalink)  
Old 01-26-2005
kicken
 
Posts: n/a
Default Re: [OT]Re: Website picture from PHP

R. Rajesh Jeba Anbiah wrote:
> kicken wrote:
> <snip>
>
>>(I used mozilla, but I think it would apply for firefox too)

>
> <snip>
>
> I bookmarked and saved your code sometimes ago. But, I see the links
> are now dead. IMHO, if they're up, you may get some feedbacks and
> suggestions to improve that code.


Problem is I don't have the code anymore. I keep my server at our house
and around last october one of my sisters friends accidently threw CD
Player into it which broke the CPU fan and also messed up the harddrive.
Couldn't get it back, lost a lot of stuff that day. I could probably
re-write it, didn't consist of much, but I simply don't want to, at
least not now.
Reply With Quote
  #15 (permalink)  
Old 01-27-2005
R. Rajesh Jeba Anbiah
 
Posts: n/a
Default Re: [OT]Re: Website picture from PHP

kicken wrote:
> R. Rajesh Jeba Anbiah wrote:
> > kicken wrote:
> > <snip>
> >
> >>(I used mozilla, but I think it would apply for firefox too)

> >
> > <snip>
> >
> > I bookmarked and saved your code sometimes ago. But, I see the

links
> > are now dead. IMHO, if they're up, you may get some feedbacks and
> > suggestions to improve that code.

>
> Problem is I don't have the code anymore. I keep my server at our

house
> and around last october one of my sisters friends accidently threw CD


> Player into it which broke the CPU fan and also messed up the

harddrive.
> Couldn't get it back, lost a lot of stuff that day. I could

probably
> re-write it, didn't consist of much, but I simply don't want to, at
> least not now.


Sad news. *Fortunately*, I did save your webshot scripts and I have
them. If you need them, please respond, I'll mail you _or_ if you
think, it's ok to post your code here, I'll be happy to do so.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Reply With Quote
  #16 (permalink)  
Old 01-27-2005
kicken
 
Posts: n/a
Default Re: [OT]Re: Website picture from PHP

R. Rajesh Jeba Anbiah wrote:
>
> Sad news. *Fortunately*, I did save your webshot scripts and I have
> them. If you need them, please respond, I'll mail you _or_ if you
> think, it's ok to post your code here, I'll be happy to do so.
>


Cool, I'll definitally take them again. Might be better to email them,
most people dislike attachments in newsgroups I think.
Reply With Quote
  #17 (permalink)  
Old 01-27-2005
R. Rajesh Jeba Anbiah
 
Posts: n/a
Default Re: [OT]Re: Website picture from PHP

kicken wrote:
> R. Rajesh Jeba Anbiah wrote:
> >
> > Sad news. *Fortunately*, I did save your webshot scripts and I have
> > them. If you need them, please respond, I'll mail you _or_ if you
> > think, it's ok to post your code here, I'll be happy to do so.
> >

>
> Cool, I'll definitally take them again. Might be better to email

them,
> most people dislike attachments in newsgroups I think.


I access NG via GG and emails are munged and so couldn't find your
email address. Would be nice if you mail me (email address at my
sig-block) or post your email address in such a way that GG won't mung
it.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Reply With Quote
  #18 (permalink)  
Old 01-27-2005
Geoff Berrow
 
Posts: n/a
Default Re: [OT]Re: Website picture from PHP

I noticed that Message-ID:
<1106856733.549354.185010@z14g2000cwz.googlegroups .com> from R. Rajesh
Jeba Anbiah contained the following:

>
>I access NG via GG


Yuk. Why not get a proper feed for free? www.news.individual.net

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Reply With Quote
  #19 (permalink)  
Old 01-30-2005
R. Rajesh Jeba Anbiah
 
Posts: n/a
Default Re: [OT]Re: Website picture from PHP

Geoff Berrow wrote:
> I noticed that Message-ID:
> <1106856733.549354.185010@z14g2000cwz.googlegroups .com> from R.

Rajesh
> Jeba Anbiah contained the following:
> >
> >I access NG via GG

>
> Yuk. Why not get a proper feed for free? www.news.individual.net


Thanks for your kind suggestion. I somehow used to web based
interface for NG since deja. Sometime ago I tried
<news://freenews.netfront.net/comp.lang.php> with Agent, but found it a
big mess (IMHO).

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Reply With Quote
  #20 (permalink)  
Old 01-30-2005
sam
 
Posts: n/a
Default Re: Website picture from PHP

hi Olaf Noehring 0000=year

I found that you solve the problem and you let the php script tp take a
screen shot

and i'm searching about that?
can you tell more information about how to do that please?


thanks
Sam

Reply With Quote
Reply
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:22 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0