?
| SitePoint Sponsor |
?




I mean counting so you can delay the next command.
The Star Circle Quest Community - Community website for SCQ fans.
Telebisyon.net - Reference guide to TV series shown in the Philippines.
Lyrics Server Online! - All the lyrics you can get on one website.
But how?




I don't know.Just thought I could suggest something.
The Star Circle Quest Community - Community website for SCQ fans.
Telebisyon.net - Reference guide to TV series shown in the Philippines.
Lyrics Server Online! - All the lyrics you can get on one website.





Yeah, do a loop that will last a few seconds, but not hog memory ;POriginally posted by friend_al_23
Why not trigger a count or something after the page pops-up?
That's really a bad idea, did you search through microsoft's developers library online?
Eric Coleman
We're consentratin' on fallin' apart
We were contenders, now throwin' the fight
I just wanna believe, I just wanna believe in us
I wouldn't recommend this cause the time it will take to run true the loop depends on the users system so there's no way in telling how long it will take on different systems.Originally posted by friend_al_23
Why not trigger a count or something after the page pops-up?





Yep, agree, recommend that you find some way to capture the OnDocumentComplete event, or something similar


I didn't receieve any emails from sitepoint to say i had any replies, but I pop back and there is 31!
Thankyou for your replies, but it looks like i am asking the impossible.
The ideal situation would be to have a screen shotgrabbed when the my client adds a link via his admin interface.
Oh well...
Thanks anyway
Eternity




maybe you had Auto-Notification turned off? or your e-mail address is wrong or bouncing?Originally posted by kjc
I didn't receieve any emails from sitepoint to say i had any replies, but I pop back and there is 31!
The Star Circle Quest Community - Community website for SCQ fans.
Telebisyon.net - Reference guide to TV series shown in the Philippines.
Lyrics Server Online! - All the lyrics you can get on one website.
Here's how I would set it up:
Have you're regular webserver (UNIX/Apache) link to the Windows webserver using a PHP script. When the URL is inputted, the UNIX server sends a request like http://www.windowsserver.com/capture.php?your_url_here
capture.php then executes the batch file (which still isn't complete though...) which opens the URL in your favourite webbrowser, waits a couple seconds then takes a screenshot. Then, the Window's server uploads the captured file to the UNIX server. The enduser will receive a message along the lines of "Your request has been submitted, come back in X minutes to see the screenshot".
So what do you guys think?
Peter


sounds good, but saying that will not do it :P


what is HQScreen.exe?Originally posted by peternm22
Yeah... I just found a way to run the screen capture program via command line. Here's what the batch file looks like so far:
The problem is, I need the program to pause for a couple seconds before executing the second line (in order to give the webpage time to load).Code:start iexplore.exe http://www.hotmail.com start C:\HQScreen.exe 0 PNG 8 picture C:\
Any ideas?




The user's system will be the server. The programmer will probably assume how much time it would take to load the browser + the site (probably 1 sec).Originally posted by Siltrince
I wouldn't recommend this cause the time it will take to run true the loop depends on the users system so there's no way in telling how long it will take on different systems.
The Star Circle Quest Community - Community website for SCQ fans.
Telebisyon.net - Reference guide to TV series shown in the Philippines.
Lyrics Server Online! - All the lyrics you can get on one website.
HQScreen.exe is a screen capture program.
I've managed to get everything working except: passing the URL from the PHP file to the batch file, and getting the batch file to pause before executing the next command.
Here's the PHP file:
And the slimmed down batch file:Code:<?php exec("C:/test.bat"); ?>
The PHP file would probably need to be modified like this:Code:start http://www.hotmail.com start C:\HQScreen.exe 0 PNG 8 picture C:\
But how would I get the batch file to use the parameter (the URL) tacked on by the PHP file? Instead of needing a hardcoded URL.Code:<?php $url = $_GET['url']; exec("C:/test.bat $url"); ?>
Peter
If you are planning to do it under Windows it's probably easier to use Windows Scripting (WSH) instead of batch files. It includes most of the functions you would need to load the app, pause and send the keystrokes.
[VBS]
'VBScript Example
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "iexplore.exe"
WshShell.AppActivate "Internet Explorer"
' Send alt+d to highlight the address bar
WshShell.SendKeys "%D"
' Send the URL + Enter
WshShell.SendKeys "http://www.winguides.com/{ENTER}"
[/VBS]
Of course you could just open iexplore.exe with the URL in the command-line, the above just gives an example of using the SendKeys function.
Have a look at my Windows Scripting Guide for more details, particularly the Send Keys method.
Simon
_________________
WinGuides.com - Windows Guide Network
I'll have a look into Windows scripting...




Hey, thanks for the resource, Simon. I had it bookmarked.Originally posted by sclausen
Have a look at my Windows Scripting Guide for more details, particularly the Send Keys method.![]()
The Star Circle Quest Community - Community website for SCQ fans.
Telebisyon.net - Reference guide to TV series shown in the Philippines.
Lyrics Server Online! - All the lyrics you can get on one website.
Alright, I've managed to recreate my code thus far using Windows Script (or is it VBS?).
Here's what I have:
But I've hit the same road block again. Pausing, and passing the URL from the PHP file to the script...Code:'VBScript Example Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run("http://www.hotmail.com") WshShell.Run("C:\HQScreen.exe 0 PNG 8 picture C:\")
Peter
You can use the Sleep method to pause the script for a number of milliseconds.
[VBS]'sleep for 2 seconds
WScript.Sleep 2000[/VBS]
How is the URL stored in the PHP file? Could you call the VBS script including the URL (e.g. "ssmaker.vbs http://www.hotmail.com/")
BTW, Windows Scripting (WSH) is the overall technology which includes the languages such as Jscript (like Java), VBScript (like Visual Basic) and others like PerlScript (which has to be installed separately).
Simon
WinGuides.com - Windows Guide Network
Empowering the Windows operating system.
Great! I got the sleep function working!
Here's what the PHP file looks like:
Any idea how to pass the URL?Code:<?php $url = "http://www.hotmail.com"; exec("script.vbs"); ?>
Also, does VBS have functions for FTP commands? If not, then I can just have the VBS script run my FTP batch file![]()




Peter, isn't this kjc's problem. Are you going to use this method too or probably just curious or something else.
The Star Circle Quest Community - Community website for SCQ fans.
Telebisyon.net - Reference guide to TV series shown in the Philippines.
Lyrics Server Online! - All the lyrics you can get on one website.
I'll probably use this too... also, I'm a little curious.
I have the entire thing working now except passing the URL. From getting to the site, capturing it, then uploading it. All nice and automated
Peter




How about on a Unix environment?
The Star Circle Quest Community - Community website for SCQ fans.
Telebisyon.net - Reference guide to TV series shown in the Philippines.
Lyrics Server Online! - All the lyrics you can get on one website.
I wouldn't even know where to start to make it work in a UNIX environment. It wouldn't be that hard though if you knew UNIX.
Peter
EDIT: One problem popped up with the script. Is there a way to delete files with VBS?




I also bookmarked this thread in case I might need to use this script.![]()
The Star Circle Quest Community - Community website for SCQ fans.
Telebisyon.net - Reference guide to TV series shown in the Philippines.
Lyrics Server Online! - All the lyrics you can get on one website.
Bookmarks