Question about Executive system ($ cmd) command .

Discussion in 'PHP' started by youlichika, Nov 10, 2010.

  1. #1
    I'm study with website screenshot these days. I selected webscreencapture. I write the official bat command into php code. I have copied three webscreencapture.exe, I would like to catch 3 websites' screenshot at the same time.
    
    $cmd1 = 'webscreencapture1.exe  "http://www.youtube.com" e:\www\test\1.jpg';
    system($cmd1);
    $cmd2 = 'webscreencapture2.exe  "http://www.google.com" e:\www\test\2.jpg';
    system($cmd2);
    $cmd3 = 'webscreencapture3.exe  "http://www.yahoo.com" e:\www\test\3.jpg';
    system($cmd3);
    
    HTML:
    Now I met a few problems.
    1. How to make PHP run $ cmd1, $ cmd2, $ cmd3 at the same time? Rather than the implementation of the queue?
    2. webscreencapture sometimes have bugs that has success get the page's screenshot, but also repeated the system ($ cmd) command many times. How to do the one command only once, then automatic termination this line system ($ cmd) command?
    3. I did not find the time delay code from webscreencapture official website , I would like to catch some of the online video sites. How to set a time delay in the system ($ cmd) ?
    4. Is it possible to set the code that every 24 hours run the screenshot code automatically ?
    Thank you.
     
    Last edited: Nov 10, 2010
    youlichika, Nov 10, 2010 IP
  2. gapz101

    gapz101 Well-Known Member

    Messages:
    524
    Likes Received:
    8
    Best Answers:
    2
    Trophy Points:
    150
    #2
    1. try do execute 3 commands at a time and see if it's possible :D
    2. try to see if there are options like webscreencapture.exe /someoptions
    3. system pause is
    sleep 3
    Code (markup):
    ; where 3 = 3 seconds
    4. cron job
    :p
     
    gapz101, Nov 10, 2010 IP
  3. youlichika

    youlichika Greenhorn

    Messages:
    74
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    Hi gapz101, how to execute 3 commands at one time? and where to put sleep3? Thanks.
    
    <?php
    $cmd1 = 'webscreencapture1.exe sleep 3 "http://www.youtube.com" e:\www\test\1.jpg';
    system($cmd1);
    $cmd2 = 'webscreencapture2.exe sleep 3 "http://www.google.com" e:\www\test\2.jpg';
    system($cmd2);
    $cmd3 = 'webscreencapture3.exe  sleep 3 "http://www.yahoo.com" e:\www\test\3.jpg';
    system($cmd3);
    ?>
    
    Code (markup):
     
    youlichika, Nov 10, 2010 IP
  4. gapz101

    gapz101 Well-Known Member

    Messages:
    524
    Likes Received:
    8
    Best Answers:
    2
    Trophy Points:
    150
    #4
    not possible!!
    
    <?php
    $cmd1 = 'webscreencapture1.exe "http://www.youtube.com" e:\www\test\1.jpg | sleep 3';
    system($cmd1);
    //...
    
    PHP:
     
    gapz101, Nov 10, 2010 IP
  5. youlichika

    youlichika Greenhorn

    Messages:
    74
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #5
    Thanks, it works. but now I know webscreencapture not support flash...
    Maybe I will search for a new one.
     
    youlichika, Nov 10, 2010 IP