31. GoogleCL
● "googlecl - Command line tools for the
Google Data APIs - Google Project Hosting"
https://code.google.com/p/googlecl/
● python で出来ていてマルチプラットホーム
で動作します.
● 導入すると google コマンドが利用できるよ
うにな
り, Blogger/Calendar/Contacts/Docs/Financ
e/Picasa/Youtube が操作できるようになる
39. Token を取得する
● ブラウザに URL を入力して認証を行い Enter を入力する.表示
されたトークンを記録.この認証は別マシンで行っても OK
% flickr_upload --auth
1. Enter the following URL into your browser
http://api.flickr.com/services/auth/?
api_key=8dcf37880da64acfe8e30bb1091376b7&perms=write
&frob=72157644983537186-197058a4fdf82491-
183451&api_sig=8e06c3da0b66cc512a3ec74131b3309b
2. Follow the instructions on the web page
3. Hit <Enter> when finished.
.
Your authentication token for this application is
XXXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXX
41. Script#!/usr/bin/perl
use strict;
use warnings;
my $WATCHDIR =
'/var/www/owncloud/data/mk/files/InstantUpload/';
my $FLICKR_TOKEN = 'xxxxxxxxxxxxxxxxxxxx-
xxxxxxxxxxxxxxxxx';
my $jpg;
open CMD, "/usr/bin/inotifywait -m -e moved_to --format %f
$WATCHDIR |";
while($jpg=<CMD>){
chomp $jpg;
my $small = $jpg;
43. 実行時の様子
$ ./inotyfy-post.pl
Setting up watches.
Watches established.
Loading file /tmp/IMG_20140621_075659-2048.jpg to
album 自動バックアップ
Uploading
/var/www/owncloud/data/mk/files/InstantUpload//IMG
_20140621_075659.jpg...
Waiting for upload results (ctrl-C if you don't care)...
/
var/www/owncloud/data/mk/files/InstantUpload//IMG_
20140621_075659.jpg is at
http://www.flickr.com/tools/uploader_edit.gne?
ids=14282595917
: