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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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. |
|
|||
|
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 |
|
|||
|
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/ |
|
|||
|
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. |
|
|||
|
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/ |
|
|||
|
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. |
|
|||
|
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/ |
|
|||
|
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/ |
|
|||
|
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/ |