SitePoint Sponsor

User Tag List

Page 2 of 5 FirstFirst 12345 LastLast
Results 26 to 50 of 122
  1. #26
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ?

  2. #27
    PHP Programmer QReyes's Avatar
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    698
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  3. #28
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But how?

  4. #29
    PHP Programmer QReyes's Avatar
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    698
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  5. #30
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by friend_al_23
    Why not trigger a count or something after the page pops-up?
    Yeah, do a loop that will last a few seconds, but not hog memory ;P

    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

  6. #31
    Non-Member Siltrince's Avatar
    Join Date
    Aug 2001
    Location
    Belgium
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by friend_al_23
    Why not trigger a count or something after the page pops-up?
    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.

  7. #32
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, agree, recommend that you find some way to capture the OnDocumentComplete event, or something similar

  8. #33
    SitePoint Addict
    Join Date
    Oct 2002
    Posts
    229
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks

    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

  9. #34
    PHP Programmer QReyes's Avatar
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    698
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Thanks

    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!
    maybe you had Auto-Notification turned off? or your e-mail address is wrong or bouncing?
    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.

  10. #35
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  11. #36
    SitePoint Addict Clete2's Avatar
    Join Date
    Mar 2002
    Location
    Columbia, South Carolina
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sounds good, but saying that will not do it :P
    My Blog
    My Photography Website
    Linux user #339185

  12. #37
    SitePoint Addict Clete2's Avatar
    Join Date
    Mar 2002
    Location
    Columbia, South Carolina
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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:

    Code:
    start iexplore.exe http://www.hotmail.com
    start C:\HQScreen.exe 0 PNG 8 picture C:\
    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).

    Any ideas?
    what is HQScreen.exe?
    My Blog
    My Photography Website
    Linux user #339185

  13. #38
    PHP Programmer QReyes's Avatar
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    698
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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 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).
    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.

  14. #39
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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:

    Code:
    <?php
    exec("C:/test.bat");
    ?>
    And the slimmed down batch file:

    Code:
    start http://www.hotmail.com
    start C:\HQScreen.exe 0 PNG 8 picture C:\
    The PHP file would probably need to be modified like this:

    Code:
    <?php
    $url = $_GET['url'];
    exec("C:/test.bat $url");
    ?>
    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.

    Peter

  15. #40
    SitePoint Member
    Join Date
    Nov 2000
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Use Windows scripting

    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

  16. #41
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll have a look into Windows scripting...

  17. #42
    PHP Programmer QReyes's Avatar
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    698
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Use Windows scripting

    Originally posted by sclausen
    Have a look at my Windows Scripting Guide for more details, particularly the Send Keys method.
    Hey, thanks for the resource, Simon. I had it bookmarked.
    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.

  18. #43
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright, I've managed to recreate my code thus far using Windows Script (or is it VBS?).

    Here's what I have:

    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:\")
    But I've hit the same road block again. Pausing, and passing the URL from the PHP file to the script...

    Peter

  19. #44
    SitePoint Member
    Join Date
    Nov 2000
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  20. #45
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great! I got the sleep function working!

    Here's what the PHP file looks like:

    Code:
    <?php
    
    $url = "http://www.hotmail.com";
    
    exec("script.vbs");
    
    ?>
    Any idea how to pass the URL?

    Also, does VBS have functions for FTP commands? If not, then I can just have the VBS script run my FTP batch file

  21. #46
    PHP Programmer QReyes's Avatar
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    698
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  22. #47
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  23. #48
    PHP Programmer QReyes's Avatar
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    698
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  24. #49
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  25. #50
    PHP Programmer QReyes's Avatar
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    698
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •