Skip to content

Commit

Permalink
appにした
Browse files Browse the repository at this point in the history
  • Loading branch information
kentaro committed Mar 25, 2010
0 parents commit 4c09ec0
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Gyazolife.app/Contents/Info.plist
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>core.sh</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
</dict>
</plist>
4 changes: 4 additions & 0 deletions Gyazolife.app/Contents/MacOS/core.sh
@@ -0,0 +1,4 @@
#!/bin/sh

/Applications/Gyazolife.app/Contents/MacOS/gyazolife &
exit 0
26 changes: 26 additions & 0 deletions Gyazolife.app/Contents/MacOS/gyazolife
@@ -0,0 +1,26 @@
#!/usr/bin/env perl
use strict;
use warnings;
use Config::Pit;
use WebService::Hatena::Fotolife;

my $config = pit_get('hatena.ne.jp');
my $filename = '/tmp/gyazolife.png';
unlink $filename if -e $filename;

if (!system "screencapture -i $filename") {
my $hatena = WebService::Hatena::Fotolife->new;
$hatena->username($config->{username});
$hatena->password($config->{password});

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

unlink $filename;
system "echo $url | pbcopy";
system "open $url";
}
36 changes: 36 additions & 0 deletions README.md
@@ -0,0 +1,36 @@
# Gyazolife

gyazoっぽい感じでフォトライフにスクリーンショットをアップロードします。

## 依存モジュール

以下のモジュールをあらかじめCPANからインストールしてください。

- WebService::Hatena::Fotolife
- Config::Pit

## 使い方

Config::PitをCPANらインストールした後、

$ ppit set hatena.ne.jp

とすると、エディタが起動するので、以下のようなYAMLを記述してください。

---
"username": はてなID
"password": パスワード
"fotolife":
"folder": アップロード先フォルダ(なければ空でいいです)

あとは、Gyazolife.appを/Application以下にコピーして適当に実行してください。

## COPYRIGHT AND LICENSE (The MIT License)

Copyright (c) Kintaro Kuribayashi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 comments on commit 4c09ec0

Please sign in to comment.