- 底下範例是用Google Picasa API 套件,自動抓取自己在Picasa的Album,並備份到Local的fold下.
- Google Login原理請參考 http://funningboy.blogspot.com/2010/02/google-finance-api.html FlowChart Step1. Get AthID Step2. Get AlbumID Step2. Get PhotoID
- Sample Code my $token = &gaGetToken($UserName,$PassWord); my $usrID = &gaUserID($UserName); my @AlbumID = &gaAlbumID($token,$usrID); my ($AbID,$PhID,$PhID2); my @PhotoID; print "UserID :: ".$usrID."\n"; foreach $AbID (@AlbumID){ print " AlbumID :: ".$AbID."\n"; @PhotoID = &gaPhotoID($token,$usrID,$AbID); foreach $PhID (@{$PhotoID[0]}){ print " PhotoID :: ".$PhID."\n"; } foreach $PhID2 (@{$PhotoID[1]}){ print " URL :: ".$PhID2."\n"; } }
- 執行結果 UserID :: funningboy AlbumID :: 5440665515743558769 PhotoID :: 5440665517561523602 URL :: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyDtL-Fz8diJzkg9PHyOx68oe0gdHnqI0wyC5Em9FNnM2nTbJ_apGF7WNOOAGNQ0UIeBHDsOOy99b9M_djHRqBgLBhooAoPMHTszRO5h6PaeZBBM_qkMZKjsSef21GmF8Q-DI7EuHebpS2/ URL :: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDclnjQyw-xpxZb3M-PbwHOMY-bvLdqQ6QhuGS9o2rtAICsh7Ocl4KC_pq2Vl9UGokmxK6De-_O_zEjzoiQOWg0rqIkjQpUZRSOsd2gNZj0NgmFEedllL97XZtz9XmFxT-1qtiK3hpCPrb/ URL :: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdyPYaueyBseWZHQxa-Z15bFIRKhLeIqNz6QLbrvOyFjy1gEEZW4GChp-nCvwQgV73jliM7_V95W4y0RIpgE-0IXctDQP4CvtezmgkCRmBud6t-n7ZDkZS1Cj6uFC5YFfcJ-F3TQVxMJH4/ URL :: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifulfiS9v13Hku94MoARnzQP2_mH9MLIOJehzSC02tave1ZpREjsUbxDcnl0VtIrhqnOOSTZDS3K3BhYUR6hwwlZXTsQzsmZk6bdE3XCE6z0jAf3GZJtMTfsvGKVIoAlFJ2E0gnx3SBu-K/ URL :: https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv-MpFa9GOhdzBk_7RtQ4BDzOwp_QeEqyvYBDQqoqxMj-OnM0vXwugax9ExFnPGe3N-_NwXA20S0UKN9ib3EuqSRfsSCKK2qJc8ZbY_KREsAk1SNNEFr2NdA9UM_-vyMlSRz7tt4_CzAio/
- 用Wget 抓 URL 到自己的Local Fold code download http://sites.google.com/site/funningboy/perl_code/GooglePicas.pl?attredirects=0&d=1
2010年3月2日 星期二
Google Picasa API
訂閱:
張貼留言 (Atom)
能夠搜尋模組,那麼得先有模組索引檔才行。 CPAN Shell 或是 CPANPLUS Shell 各有存放索引的位置。CPAN Shell 通常是放於家目錄底下的 .cpan 資料夾內,實際路徑為 $HOME/.cpan/sources/modules/02packages.details.txt.gz ,CPANPLUS 則是放置於 $HOME/.cpanplus/02packages.details.txt.gz 。
回覆刪除