Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e058b431cf
Fetching contributors…

Cannot retrieve contributors at this time

executable file 37 lines (24 sloc) 0.74 kb
#!/usr/bin/env perl
=head1 USAGE
Launch in the command line, put it into background:
> shoot-myself-every-60s &
Requires the 'convert' program from ImageMagick, and 'imagesnap' program
from http://iharder.net/current/macosx/imagesnap/.
Photos are saved to ~/Pictures/shoot-myself/.
=cut
use strict;
use warnings;
use IO::All;
use 5.010;
while(1) {
my $time = time;
my ($day, $month, $year) = (localtime($time))[3, 4, 5];
$year += 1900;
my $dir = "$ENV{HOME}/Pictures/shoot-myself/$year-$month-$day";
io->dir($dir)->mkdir;
my $file = "$dir/$time";
system("imagesnap ${file}.tiff >/dev/null 2>/dev/null");
system("convert ${file}.tiff ${file}.jpg");
unlink("${file}.tiff");
sleep 60;
}
Jump to Line
Something went wrong with that request. Please try again.