Here is a very useful terminal script for Linux and OSX users, which saves a successive series of webcam images when the URL of that webcam stays the same, as is usually the case. It uses the terminal program "curl" to grab the images, names each one using the exact date and time, and puts them in a folder of your choice.
Copy and paste the above into a plain text file and name it what you want, with an "sh" extension.
I have a set of scripts for different webcams I like, in my home folder, in a "bin" directory. Make the script file executable with permissions of 755. You can do that in the Properties dialog of Linux, for example, Ubuntu which is what I use.
The first line is the shebang, you might need something different depending on what terminal shell you are using.
If you go open the script where the images will be kept with your terminal, you don't need the line starting with "cd" but with that line you can just type the name of your script and not have to bother changing directories.
Set the number of seconds that the webcam updates, and/or the period of seconds you want a new image grabbed, in the line starting with "sleep".
The files are named as so in this script, in the line starting with "FILENAME=" :
122908-181521.jpg
The date first, then the time.
I have had this running for days at a time sometimes, just so I can grab interesting sequences of ships going through a canal in my home town. I select what I want, make a little slideshow, and trash the rest usually so I don't fill up my hard drive.
Hope this is useful to someone!
| Code: |
| #!/bin/bash
while true do echo "\%H%M%S Fetching image..." cd /home/kenn/Documents/Webcams/lakecam FILENAME=`date +"%m%d%y-%H%M%S"` curl -o $FILENAME.jpg http://www.galesofnovember.org/webcam.jpg sleep 20 done & |
Copy and paste the above into a plain text file and name it what you want, with an "sh" extension.
I have a set of scripts for different webcams I like, in my home folder, in a "bin" directory. Make the script file executable with permissions of 755. You can do that in the Properties dialog of Linux, for example, Ubuntu which is what I use.
The first line is the shebang, you might need something different depending on what terminal shell you are using.
If you go open the script where the images will be kept with your terminal, you don't need the line starting with "cd" but with that line you can just type the name of your script and not have to bother changing directories.
Set the number of seconds that the webcam updates, and/or the period of seconds you want a new image grabbed, in the line starting with "sleep".
The files are named as so in this script, in the line starting with "FILENAME=" :
122908-181521.jpg
The date first, then the time.
I have had this running for days at a time sometimes, just so I can grab interesting sequences of ships going through a canal in my home town. I select what I want, make a little slideshow, and trash the rest usually so I don't fill up my hard drive.
Hope this is useful to someone!
