Hatena::Groupsubtech

subpop

2007-11-21

Fotolife uploader like Gyazo

22:39 |  Fotolife uploader like Gyazo - subpop を含むブックマーク はてなブックマーク -  Fotolife uploader like Gyazo - subpop  Fotolife uploader like Gyazo - subpop のブックマークコメント

#!/opt/local/bin/perl

use YAML;
use IPC::Run qw(run);
use WebService::Hatena::Fotolife;

# config file must be YAML-formatted:
#   hatena_id:       your-hatena-id
#   hatena_password: your-hatena-password

my $conf = YAML::LoadFile('/Users/kentaro/.online_accounts');
my $filename = '/tmp/screencapture.png';

if (run(['screencapture', '-i', $filename])) {
    my $hatena = WebService::Hatena::Fotolife->new;
    $hatena->username($conf->{hatena_id});
    $hatena->password($conf->{hatena_password});

    my ($date) =  $hatena->createEntry(
        title    => $ARGV[0],
        filename => $filename,
    ) =~ /(\d{14})$/;
    my $url = sprintf "http://f.hatena.ne.jp/%s/%s", $conf->{hatena_id}, $date;

    run(['echo', $url], '|', [qw(pbcopy)]);
    print "Successfully uploaded: $url\n";
}

CeniaCenia 2012/08/26 00:36 No more s***. All posts of this qaulity from now on

teavsgcteavsgc 2012/08/26 21:57 r6rRe5 <a href="http://loullwvuyeya.com/">loullwvuyeya</a>

wpdvnldtewpdvnldte 2012/08/27 03:03 9vgtXR , [url=http://jdsbzjopsonf.com/]jdsbzjopsonf[/url], [link=http://skidwdlydflk.com/]skidwdlydflk[/link], http://zekobrkmfsmm.com/

cwnycdaecwnycdae 2012/08/28 18:56 2hWMSP , [url=http://crwvwfrrzmcn.com/]crwvwfrrzmcn[/url], [link=http://fxfxnhncvmsv.com/]fxfxnhncvmsv[/link], http://rxqzwiogikzx.com/

ゲスト