wmaファイルをmp3にしたいので、書いたの
#!/bin/sh for wma in $(find -name "*.wma"); do echo "input -> ${wma}" output_file=`echo ${wma} | sed -e s/.wma$/.mp3/i` echo "output -> ${output_file}" ffmpeg -i ${wma} ${output_file} done
よかったとおもう記事
組み込み開発フォーラム - MONOist(モノイスト)
テストをしてもらうにも、テスト仕様書がないとかひどいこともあったり。
コボコラを大量に集めてみた - phaの日記
シュールすぎて、面白かった。
2009年、皆既日食観測【働くモノニュース : 人生VIP職人ブログwww】
福岡では無事に見れました。
3Dスキャナを使ってまだ生まれていない赤ちゃんを抱っこする方法 - GIGAZINE
3Dスキャナ恐るべし。
冷ご飯で♪簡単カルボナーラ風リゾット by めけてー 【クックパッド】 簡単おいしいみんなのレシピが304万品
牛乳が多すぎて、ちょっとべっちゃっとした。
俺も遂に就職したwwww - (旧)ベア速(旧)ベア速
可哀想すぎた。。。
[reading]戦うプログラマー
[api][perl]amazonのほしいものリストを取得した。
amazonのExampleを改造して作った。
apiを利用するプログラムを始めて書いたが、XPathの使いかたが分かったのは、よかったと思う。
また、いろいろなapiを使って遊んで見ようと思う。
概要
- amazonのapiを利用するには。Amazonへのアクセスキーが必要
- ほしいものリスト(wishlist)を取得するには、wishlistを特定するListIdが必要
- ListIdは、ほしいものリストのページまで移動して、URLを見ること
- http://www.amazon.co.jp/registry/wishlist/{ここにListIdがあるよ}
- ListIdは、ほしいものリストのページまで移動して、URLを見ること
- ほしいものリストを取得した時に、取得できるアイテム数は1度に10個までなので、すべてのアイテムを取得するために、ProductPageをループさせた。
ソース
#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent qw($ua get); use MIME::Base64; use XML::XPath; use Date::Format; # Define the parameters in the REST request. # Customer cannot change the following values. my $EndPoint = "http://ecs.amazonaws.jp/onca/xml"; my $service = "AWSECommerceService"; my $accesskey = "XXXXXXXXXX"; my $operation = "ListLookup"; my $listType = "WishList"; my $listId="AAAAAAAA"; my $responseGroup="ItemAttributes"; my $condition="All"; my $version = "2008-08-19"; for(my $productPage=1; $productPage<=999; $productPage++){ # Assemble the REST request URL. my $request = "$EndPoint?" . "Service=$service&" . "AWSAccessKeyId=$accesskey&" . "Operation=$operation&" . "ListType=$listType&" . "ListId=$listId&" . "ResponseGroup=$responseGroup&" . "Condition=$condition&" . "ProductPage=$productPage&" . "Version=$version"; # Send the request using HTTP GET. my $ua = new LWP::UserAgent; $ua->timeout(30); my $response = $ua->get($request); my $xml = $response->content; my $xp = XML::XPath->new(xml => $xml); ##XPathを使ってエラーがあれば、ブレイク if ( $xp->find("//Error") ) { # print "There was an error processing your request:\n", # " Error code: ", $xp->findvalue("//Error/Code"), "\n", # " ", $xp->findvalue("//Error/Message"), "\n\n"; last; } #Xpathをつかって、アイテム1つ1つに対して、処理を行う。 { for (my $i=1; $i<=10; $i++){ if (! $xp->find("/ListLookupResponse/Lists/List/ListItem[$i]")){ last; } # print "ASIN : ", $xp->findvalue("/ListLookupResponse/Lists/List/ListItem[$i]/Item/ASIN"),"\n"; # print "detailPageUrl : ", $xp->findvalue("/ListLookupResponse/Lists/List/ListItem[$i]/Item/DetailPageURL"),"\n"; # print "Author: ", $xp->find("/ListLookupResponse/Lists/List/ListItem[$i]/Item/ItemAttributes/Author"), "\n"; # print "ISBN: ", $xp->find("/ListLookupResponse/Lists/List/ListItem[$i]/Item/ItemAttributes/ISBN"), print"TITLE:", $xp->find("/ListLookupResponse/Lists/List/ListItem[$i]/Item/ItemAttributes/Title"), " "; print "Price: ", $xp->find("/ListLookupResponse/Lists/List/ListItem[$i]/Item/ItemAttributes/ListPrice/FormattedPrice"), "\n"; } } }