

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>“南船北馬”</title>
	<atom:link href="http://aoshiman.net/weblog/feed/" rel="self" type="application/rss+xml" />
	<link>http://aoshiman.net/weblog</link>
	<description>不定期更新且つ、最新情報に対して常に周回遅れ気味に追っかけているブログです</description>
	<lastBuildDate>Tue, 20 Oct 2009 11:07:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[memo]Blog引っ越しました。</title>
		<link>http://aoshiman.net/weblog/2009/10/20/goodbye-wordpress/</link>
		<comments>http://aoshiman.net/weblog/2009/10/20/goodbye-wordpress/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 11:01:47 +0000</pubDate>
		<dc:creator>aoshiman</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[memo]]></category>

		<guid isPermaLink="false">http://aoshiman.net/weblog/?p=524</guid>
		<description><![CDATA[				約１年間こちらでBlogを書いてきましたが、この度下記サイトへ引っ越ししました。
				
				aoshiman.org
				
				WordPressは手軽で、プラグインもテーマも豊富で良いのですが、次のBlogシステムが気に入っているので、いったんサヨナラします。レンタルサーバの契約はまだ残っていますし、こちらのエントリー達はどうしようかまだ決めかねていますが、しばらく残しています。
]]></description>
			<content:encoded><![CDATA[				<p>約１年間こちらでBlogを書いてきましたが、この度下記サイトへ引っ越ししました。</p>
				<ul>
				<li><a target="_blank" href="http://aoshiman.org/blog/">aoshiman.org</a></li>
				</ul>
				<p>WordPressは手軽で、プラグインもテーマも豊富で良いのですが、次のBlogシステムが気に入っているので、いったんサヨナラします。レンタルサーバの契約はまだ残っていますし、こちらのエントリー達はどうしようかまだ決めかねていますが、しばらく残しています。</p>
]]></content:encoded>
			<wfw:commentRss>http://aoshiman.net/weblog/2009/10/20/goodbye-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Python]CORESERVERのSSH登録を自動化する</title>
		<link>http://aoshiman.net/weblog/2009/09/16/coreserver_ssh/</link>
		<comments>http://aoshiman.net/weblog/2009/09/16/coreserver_ssh/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 13:38:53 +0000</pubDate>
		<dc:creator>aoshiman</dc:creator>
				<category><![CDATA[CORESERVER]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[urllib]]></category>

		<guid isPermaLink="false">http://aoshiman.net/weblog/?p=488</guid>
		<description><![CDATA[				このBlogをホスティングしているCORESERVERは手頃で良いんだけど、SSH接続する前にWeb上の管理画面で、SSH接続のためホスト情報をサーバーに登録する必要があり、この作業が結構面倒くさい。一回登録すれば３０日は有効なのだけど、その間に別の場所からSSH接続したいときは登録しなおさなければならない。なにか良い方法はないかなと捜していたら自動登録スクリプトを作成している方々がいました。
				
				coreserverのSSH登録を自動化するスクリプト &#8211; Geek Not Found
				xrea(coreserver) SSHホスト登録スクリプト &#8211; Kerosoft : Modus Operandi
				
				要はIPアドレス、ID、パスワードなどをPOSTしてあげれば良いみたい。上のエントリーでは、ShellscriptとPerlで書かれていたので、内容を参考にしつつPythonで書きました。
				
#!/usr/bin/env python
# coding: utf-8

import urllib

def get_ip():
    f = urllib.urlopen('http://dyn.value-domain.com/cgi-bin/dyn.fcg?ip')
    ip = f.read()
    return ip

def regist_host(ip, url):
    userid = 'ACCOUNT'
    passwd = 'PASSWORD'
    keyword = u'SSH登録'
   [...]]]></description>
			<content:encoded><![CDATA[				<p>このBlogをホスティングしているCORESERVERは手頃で良いんだけど、SSH接続する前にWeb上の管理画面で、SSH接続のためホスト情報をサーバーに登録する必要があり、この作業が結構面倒くさい。一回登録すれば３０日は有効なのだけど、その間に別の場所からSSH接続したいときは登録しなおさなければならない。なにか良い方法はないかなと捜していたら自動登録スクリプトを作成している方々がいました。</p>
				<ul>
				<li><a href="http://d.hatena.ne.jp/int128/20090113/1231850343">coreserverのSSH登録を自動化するスクリプト &#8211; Geek Not Found</a></li>
				<li><a href="http://mo.kerosoft.com/0119">xrea(coreserver) SSHホスト登録スクリプト &#8211; Kerosoft : Modus Operandi</a></li>
				</ul>
				<p>要はIPアドレス、ID、パスワードなどをPOSTしてあげれば良いみたい。上のエントリーでは、ShellscriptとPerlで書かれていたので、内容を参考にしつつPythonで書きました。</p>
				<pre class="brush: python;">
#!/usr/bin/env python
# coding: utf-8

import urllib

def get_ip():
    f = urllib.urlopen('http://dyn.value-domain.com/cgi-bin/dyn.fcg?ip')
    ip = f.read()
    return ip

def regist_host(ip, url):
    userid = 'ACCOUNT'
    passwd = 'PASSWORD'
    keyword = u'SSH登録'
    encoding = 'shift-jis'
    p = [
        ('id', userid),
        ('pass', passwd),
        ('remote_host', ip),
        ('ssh2', keyword.encode(encoding)),
    ]

    params = urllib.urlencode(p)
    #print params
    up = urllib.urlopen(url, params)
    #print up.read()

if __name__ == '__main__':
   url = 'https://ss1.coressl.jp/www.sXX.coreserver.jp/jp/admin.cgi'
   ip = get_ip()
   regist_host(ip, url)
</pre>
				<p>一応問題なくホスト登録出来たので大丈夫だとは思いますが、使用する場合は自己責任でお願いします。Pythonのバージョンは2.6で確認取っています。useridとpasswdは各自設定したものを、urlのsXXには自分のサーバ番号を入れて下さい。<br />
				<span id="more-488"></span></p>
				<h3>クエリ文字列を作成するところでハマった点</h3>
				<p>クエリ文字列を作成する箇所（urlencode）を<a href="http://www.python.jp/doc/release/lib/node579.html">Python ライブラリリファレンス</a>を参考にして作っていたのですが、どうも辞書で作るとクエリ文字列の順序が意図したように作れないみたい。</p>
				<pre class="brush: python;">
#!/usr/bin/env python
# coding: utf-8

import urllib

#ディクショナリの場合
query = {
    'id': &quot;userid&quot;,
    'pass': &quot;passwd&quot;,
    'remotehost': &quot;ip&quot;,
}

#タプルの場合
query2 = [
    ('id', &quot;userid&quot;),
    ('pass', &quot;passwd&quot;),
    ('remotehost', &quot;ip&quot;),
]

print urllib.urlencode(query)
print urllib.urlencode(query2)
</pre>
				<p>実行結果</p>
				<pre class="brush: bash;">

% python ~/python/bin/encode.py
remotehost=ip&amp;id=userid&amp;pass=passwd #ディクショナリ
id=userid&amp;pass=passwd&amp;remotehost=ip #タプル
</pre>
				<p>これで小一時間悩みました。</p>
]]></content:encoded>
			<wfw:commentRss>http://aoshiman.net/weblog/2009/09/16/coreserver_ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Python]ハードディスクの温度を定期的にTwitterにポストする</title>
		<link>http://aoshiman.net/weblog/2009/09/04/python_hdtemp/</link>
		<comments>http://aoshiman.net/weblog/2009/09/04/python_hdtemp/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 11:00:59 +0000</pubDate>
		<dc:creator>aoshiman</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://aoshiman.net/weblog/?p=444</guid>
		<description><![CDATA[				自宅サーバ（CentOS5.3）は極端に熱のこもる場所に設置してあるわけではないので、廃熱に関してはそこそこ大丈夫だと思っているのだけど、それでもハードディスクとかの温度は心配。そこで会社にいても状況を把握出来るように、4時間おきにハードディスクの温度をTwtterにポストしている。以下備忘録的にまとめてみた。
				hddtempのインストール
				まずはハードディスクの温度を計測する為にhddtempをインストールする。CentOSの場合はyumでインストール可能。
				# yum -y install hddtemp
使用する時は、hddtemp disk名をタイプして実行する
# hddtemp /dev/sda
/dev/sda: WDC WD10EADS-00L5B1: 39°C

				hddtempの値を取得してTwitterにポストする
				以下ソースコード（Pythonなのに全くインデントしてない>]]></description>
			<content:encoded><![CDATA[				<p>自宅サーバ（CentOS5.3）は極端に熱のこもる場所に設置してあるわけではないので、廃熱に関してはそこそこ大丈夫だと思っているのだけど、それでもハードディスクとかの温度は心配。そこで会社にいても状況を把握出来るように、4時間おきにハードディスクの温度をTwtterにポストしている。以下備忘録的にまとめてみた。</p>
				<h3>hddtempのインストール</h3>
				<p>まずはハードディスクの温度を計測する為にhddtempをインストールする。CentOSの場合はyumでインストール可能。</p>
				<pre class="brush: bash;"># yum -y install hddtemp</pre>
<p>使用する時は、hddtemp disk名をタイプして実行する</p>
<pre class="brush: bash;"># hddtemp /dev/sda
/dev/sda: WDC WD10EADS-00L5B1: 39°C
</pre>
				<h3>hddtempの値を取得してTwitterにポストする</h3>
				<p>以下ソースコード（Pythonなのに全くインデントしてない><）</p>
				<pre class="brush: python;">
#!/usr/bin/env python
# coding: utf-8

import sys
import twitter
from datetime import *

USERNAME = &quot;TWITTER_ACCOUNT&quot;
PASSWORD = &quot;ACCOUNT_PASSWORD&quot;

DATETIME = datetime.now()
TIME_STR = DATETIME.strftime(&quot;%I:%M %p&quot;)
api = twitter.Api(USERNAME, PASSWORD)

t = sys.stdin.readline()
info = t.rstrip() + &quot; &quot; + &quot;at&quot; + &quot; &quot; +TIME_STR

post = u&quot;%s&quot; % (info)
api.PostUpdate(post)
# print post
</pre>
				<p>Twitterへポストするモジュールは<a href="http://code.google.com/p/python-twitter/">python-twitter</a>を使用。<br />
				注意した点は２つあって、１つは受け取った標準出力に改行がついてきて、そのままではTwitterにうまくポスト出来ないのでrstripしていること。もうひとつは、ポストする内容にその時刻を追加したこと（取得した温度だけをポストする場合、温度が毎回同じだとポストする内容が一緒になってしまい、Twiiter仕様上無効ポストになってしまう）</p>
				<h3>シェルスクリプトの作成</h3>
				<pre class="brush: bash;">
#!/bin/sh
export LANG=ja_JP.utf-8
/usr/sbin/hddtemp /dev/sda | /usr/local/bin/python /usr/local/bin/hdd_info.py
exit
</pre>
				<p>ここでは、/dev/sdaの温度を取得し、先ほどのスクリプト（hdd_info.py）へパイプで繋いでいる。ディスク名は環境によって違うと思うので置き換えて下さい。最初どうしても°CがTwitterにポストされず困っていたのだけど、export LANG=ja_JP.utf-8を記述することでポスト出来るようになった（<a href="http://twitter.com/katsu2000x">katsu2000x</a>さんthanks！）<br />
				このシェルスクリプトをCronで定時実行させるとこのようになる。Twitterアカウントは本人のアカウントを使用するとTLを汚すような気がして、それ用のアカウントを作った。</p>
				<p><a class="" rel="" title="20090904_01" href="http://www.flickr.com/photos/aoshiman/3886938526/"><img src="http://static.flickr.com/3516/3886938526_57daec1c6c.jpg" alt="20090904_01"></a></p>
				<p>
				[2009年9月13日追記]<br />
				twitterでフォローしているmagicalhatさんが、perlでさくっと書いてくれてトラバ貰いました。勉強になります！<br />
				[追記ここまで]</p>
]]></content:encoded>
			<wfw:commentRss>http://aoshiman.net/weblog/2009/09/04/python_hdtemp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[LIFE]美味い野菜とは</title>
		<link>http://aoshiman.net/weblog/2009/08/17/good-veg/</link>
		<comments>http://aoshiman.net/weblog/2009/08/17/good-veg/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 11:28:23 +0000</pubDate>
		<dc:creator>aoshiman</dc:creator>
				<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://aoshiman.net/weblog/?p=404</guid>
		<description><![CDATA[				
				夏休み（といっても２日間だけだが）の最終日に実家で昼食を食べた。実家は専業農家で野菜も作っており、今日は今朝採れたばかりの茄子を使った炒め物を作ってくれた。これが本当に美味かった。いつもスーパーで買って食べる野菜とは違い恐ろしく柔らかい。野菜の美味さとは、農薬の使用量、有機、非有機で決まるのでなく、収穫してからどれだけ早く食べるかによるんだなと思った。
]]></description>
			<content:encoded><![CDATA[				<p><a class="" rel="" title="P1000858" href="http://www.flickr.com/photos/aoshiman/3065060277/"><img src="http://static.flickr.com/3058/3065060277_a0492b3a01.jpg" alt="P1000858"></a></p>
				<p>夏休み（といっても２日間だけだが）の最終日に実家で昼食を食べた。実家は専業農家で野菜も作っており、今日は今朝採れたばかりの茄子を使った炒め物を作ってくれた。これが本当に美味かった。いつもスーパーで買って食べる野菜とは違い恐ろしく柔らかい。野菜の美味さとは、農薬の使用量、有機、非有機で決まるのでなく、収穫してからどれだけ早く食べるかによるんだなと思った。</p>
]]></content:encoded>
			<wfw:commentRss>http://aoshiman.net/weblog/2009/08/17/good-veg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IXY DIGITAL 920 ISはスゴイかも</title>
		<link>http://aoshiman.net/weblog/2009/07/22/ixy-digital-920-is/</link>
		<comments>http://aoshiman.net/weblog/2009/07/22/ixy-digital-920-is/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 12:21:31 +0000</pubDate>
		<dc:creator>aoshiman</dc:creator>
				<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://aoshiman.net/weblog/?p=386</guid>
		<description><![CDATA[				先日、あのmiyagawa氏もBlogにて言及していたIXY DIGITAL 920 ISを購入しました。これは良いですね。
				
				
				
				
				
				これは先日、TDLに行ったときの写真。露出やらISOやらをちょこちょこ弄りながら撮ったので、今イチな写真が多かったのですが、それでも雰囲気のある良い写真も撮れました。これからの季節は外出するイベントが増えるので、良い写真を撮りまくってみたいですね。
				
				
				
				
				Canon デジタルカメラ IXY DIGITAL (イクシ) 920 IS ゴールド  IXYD920IS(GL)
				
				
				定価 : ￥ 20,980
				発売日 : 2008/09/20
				出版社/メーカー : キヤノン
				おすすめ度 :  (14 reviews)
				
				
				
				
]]></description>
			<content:encoded><![CDATA[				<p>先日、あの<a href="http://twitter.com/miyagawa">miyagawa氏</a>も<a href="http://blog.bulknews.net/mt/archives/002236.html">Blogにて言及していた</a>IXY DIGITAL 920 ISを購入しました。これは良いですね。</p>
				<p><a class="" rel="" title="IMG_0054" href="http://www.flickr.com/photos/aoshiman/3737898849/"><img src="http://static.flickr.com/3517/3737898849_0546aa51ba.jpg" alt="IMG_0054"></a></p>
				<p><a class="" rel="" title="IMG_0038" href="http://www.flickr.com/photos/aoshiman/3738768452/"><img src="http://static.flickr.com/3445/3738768452_29ec0a175d.jpg" alt="IMG_0038"></a></p>
				<p><span id="more-386"></span></p>
				<p><a class="" rel="" title="IMG_0195" href="http://www.flickr.com/photos/aoshiman/3738310205/"><img src="http://static.flickr.com/2488/3738310205_41626c243a.jpg" alt="IMG_0195"></a></p>
				<p><a class="" rel="" title="IMG_0125" href="http://www.flickr.com/photos/aoshiman/3739111140/"><img src="http://static.flickr.com/3475/3739111140_fa03fc119b.jpg" alt="IMG_0125"></a></p>
				<p>これは先日、TDLに行ったときの写真。露出やらISOやらをちょこちょこ弄りながら撮ったので、今イチな写真が多かったのですが、それでも雰囲気のある良い写真も撮れました。これからの季節は外出するイベントが増えるので、良い写真を撮りまくってみたいですね。</p>
				<table class="yztbl">
				<tr valign="top">
				<td class="yz-image"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/B001G91SGE/aoshiman-22/" target="_blank"><img src="http://ecx.images-amazon.com/images/I/41akkmxdTsL._SL160_.jpg" style="border: none;" /></a></td>
				<td class="yz-info">
				<div class="yz-name"><a href="http://yasazon.com/asin/B001G91SGE.html" target="_blank"><img src="http://images-jp.amazon.com/images/G/09/icons/icon-ce.gif" border="0" align="left"></a><a href="http://www.amazon.co.jp/exec/obidos/ASIN/B001G91SGE/aoshiman-22/" name="yzlink" target="_blank">Canon デジタルカメラ IXY DIGITAL (イクシ) 920 IS ゴールド  IXYD920IS(GL)</a></div>
				<div class="yz-detail" style="font-size:small">
				<ul style="margin-top:0;margin-bottom:0">
				<li>定価 : <span>￥ 20,980</span>
				<li>発売日 : <span>2008/09/20</span>
				<li>出版社/メーカー : <span><a href="http://yasazon.com/s/aoshiman-22/%E3%82%AD%E3%83%A4%E3%83%8E%E3%83%B3.html">キヤノン</a></span>
				<li>おすすめ度 : <span><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-4-5.gif" style="border: none;" /> (14 reviews)</span></ul>
				</div>
				</td>
				</tr>
				</table>
]]></content:encoded>
			<wfw:commentRss>http://aoshiman.net/weblog/2009/07/22/ixy-digital-920-is/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Movie]ターミネーター４ 観てきた</title>
		<link>http://aoshiman.net/weblog/2009/06/07/movie_t4/</link>
		<comments>http://aoshiman.net/weblog/2009/06/07/movie_t4/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 11:38:44 +0000</pubDate>
		<dc:creator>aoshiman</dc:creator>
				<category><![CDATA[Movie]]></category>

		<guid isPermaLink="false">http://aoshiman.net/weblog/?p=368</guid>
		<description><![CDATA[				
				
				昨日、たまには映画でも観ようと近くのシネコンへ。
				そこでたまたま先行ロードショーをやっていたターミネーター４を観ました。
				
				シリーズものは回を重ねるごとに品質が劣化することが多々あり、正直期待していなかったのですが、良い意味で予想を裏切られました。特にクリスチャン・ベイル（ジョン・コナー役）がすごく良かったです。ダークナイト（ヒース・レジャー）の時もそうですが、この人、主役をやってもなぜか脇役を引き立ててしまうんですよね。今回も、この映画での超重要人物（マーカス・ライト）をうまく引き立てています。でも自分自身の存在感は重く残している・・
				すごい役者さんです。
				嫁さんはターミネーターシリーズをまったく観ていませんでしたが、なかなか楽しめたそうです。
				
				
				
				
				ダークナイト 特別版 [DVD]
				
				
				定価 : ￥ 3,980
				発売日 : 2008/12/10
				出版社/メーカー : ワーナー・ホーム・ビデオ
				おすすめ度 :  (159 reviews)ピッコロと神様の物語本当にアメコミ映画なのか!?ジョーカーのみでもよかったかな？深みのある映画人間は善であり、同時に悪である。
				
				
				
				
]]></description>
			<content:encoded><![CDATA[				<p><a href="http://www.youtube.com/watch?v=0V1p2Bk9GYs"><img src="http://img.youtube.com/vi/0V1p2Bk9GYs/default.jpg" width="130" height="97" border=0></a><br />
				<br />
				昨日、たまには映画でも観ようと近くのシネコンへ。<br />
				そこでたまたま先行ロードショーをやっていたターミネーター４を観ました。<br />
				<span id="more-368"></span><br />
				シリーズものは回を重ねるごとに品質が劣化することが多々あり、正直期待していなかったのですが、良い意味で予想を裏切られました。特にクリスチャン・ベイル（ジョン・コナー役）がすごく良かったです。ダークナイト（ヒース・レジャー）の時もそうですが、この人、主役をやってもなぜか脇役を引き立ててしまうんですよね。今回も、この映画での超重要人物（マーカス・ライト）をうまく引き立てています。でも自分自身の存在感は重く残している・・<br />
				すごい役者さんです。<br />
				嫁さんはターミネーターシリーズをまったく観ていませんでしたが、なかなか楽しめたそうです。</p>
				<table class="yztbl">
				<tr valign="top">
				<td class="yz-image"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/B001AQYQ1M/aoshiman-22/" target="_blank"><img src="http://ecx.images-amazon.com/images/I/51Ee-EBYKHL._SL160_.jpg" style="border: none;" /></a></td>
				<td class="yz-info">
				<div class="yz-name"><a href="http://yasazon.com/asin/B001AQYQ1M.html" target="_blank"><img src="http://images-jp.amazon.com/images/G/09/icons/icon-dvd.gif" border="0" align="left"></a><a href="http://www.amazon.co.jp/exec/obidos/ASIN/B001AQYQ1M/aoshiman-22/" name="yzlink" target="_blank">ダークナイト 特別版 [DVD]</a></div>
				<div class="yz-detail" style="font-size:small">
				<ul style="margin-top:0;margin-bottom:0">
				<li>定価 : <span>￥ 3,980</span>
				<li>発売日 : <span>2008/12/10</span>
				<li>出版社/メーカー : <span><a href="http://yasazon.com/s/aoshiman-22/%E3%83%AF%E3%83%BC%E3%83%8A%E3%83%BC%E3%83%BB%E3%83%9B%E3%83%BC%E3%83%A0%E3%83%BB%E3%83%93%E3%83%87%E3%82%AA.html">ワーナー・ホーム・ビデオ</a></span>
				<li>おすすめ度 : <span><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-4-5.gif" style="border: none;" /> (159 reviews)</span><br /><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-5-0.gif">ピッコロと神様の物語<br /><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-5-0.gif">本当にアメコミ映画なのか!?<br /><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-4-0.gif">ジョーカーのみでもよかったかな？<br /><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-5-0.gif">深みのある映画<br /><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-5-0.gif">人間は善であり、同時に悪である。</ul>
				</div>
				</td>
				</tr>
				</table>
]]></content:encoded>
			<wfw:commentRss>http://aoshiman.net/weblog/2009/06/07/movie_t4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ACIDMAN ある証明</title>
		<link>http://aoshiman.net/weblog/2009/05/11/acidman-aru-syoumei/</link>
		<comments>http://aoshiman.net/weblog/2009/05/11/acidman-aru-syoumei/#comments</comments>
		<pubDate>Mon, 11 May 2009 12:06:56 +0000</pubDate>
		<dc:creator>aoshiman</dc:creator>
				<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://aoshiman.net/weblog/?p=362</guid>
		<description><![CDATA[				
				ACIDMANの全ての曲が好きだが、これは名曲中の名曲
				特にこのライブ映像はヤバすぎる
]]></description>
			<content:encoded><![CDATA[				<p><a href="http://www.youtube.com/watch?v=tvZqME9Ce0A"><img src="http://img.youtube.com/vi/tvZqME9Ce0A/default.jpg" width="130" height="97" border=0></a><br />
				ACIDMANの全ての曲が好きだが、これは名曲中の名曲<br />
				特にこのライブ映像はヤバすぎる</p>
]]></content:encoded>
			<wfw:commentRss>http://aoshiman.net/weblog/2009/05/11/acidman-aru-syoumei/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[WordPress]WPtouch iPhone Themeを導入した</title>
		<link>http://aoshiman.net/weblog/2009/05/08/wptouch/</link>
		<comments>http://aoshiman.net/weblog/2009/05/08/wptouch/#comments</comments>
		<pubDate>Fri, 08 May 2009 13:23:46 +0000</pubDate>
		<dc:creator>aoshiman</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://aoshiman.net/weblog/?p=353</guid>
		<description><![CDATA[				このBlogをiPhone、iPod Touchで閲覧しやすくする為WPtouchというPluginを導入しました。以下スクリーンショット
				
				シンプルでとてもわかり易いです。
				
				本文も見やすくなっています。
				iPhoneで見てくれる方も増えてきてますし、しばらく様子を見てみます。
]]></description>
			<content:encoded><![CDATA[				<p>このBlogをiPhone、iPod Touchで閲覧しやすくする為<a href="http://www.bravenewcode.com/wptouch/">WPtouch</a>というPluginを導入しました。以下スクリーンショット</p>
				<p><a class="" rel="" title="IMG_0010.PNG" href="http://www.flickr.com/photos/aoshiman/3512917558/"><img src="http://static.flickr.com/3380/3512917558_f861346f39.jpg" alt="IMG_0010.PNG"></a></p>
				<p>シンプルでとてもわかり易いです。</p>
				<p><a class="" rel="" title="IMG_0012.PNG" href="http://www.flickr.com/photos/aoshiman/3512917852/"><img src="http://static.flickr.com/3329/3512917852_6f98e0ee69.jpg" alt="IMG_0012.PNG"></a></p>
				<p>本文も見やすくなっています。<br />
				iPhoneで見てくれる方も増えてきてますし、しばらく様子を見てみます。</p>
]]></content:encoded>
			<wfw:commentRss>http://aoshiman.net/weblog/2009/05/08/wptouch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Python]Twitter版LogWatchのようなもの</title>
		<link>http://aoshiman.net/weblog/2009/05/05/twitter_logwatch/</link>
		<comments>http://aoshiman.net/weblog/2009/05/05/twitter_logwatch/#comments</comments>
		<pubDate>Tue, 05 May 2009 10:53:01 +0000</pubDate>
		<dc:creator>aoshiman</dc:creator>
				<category><![CDATA[Gmail]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[smtplib]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://aoshiman.net/weblog/?p=312</guid>
		<description><![CDATA[				GW期間に３連休（年に２回あるかどうか！というくらい貴重）をもらったので、Pythonのお勉強を兼ねてTwitter版LogWatchのようなものを作ってみました。
				
				
				24時過ぎとかにcronで実行させると、FriendsとFollowersそれぞれのリストを前日に保存しておいたリストと照合し、追加した（された）および削除した（された）Friends/FollowersをリストアップしてGmailで自分宛に送信します。Twitter APIを扱うモジュールはPython-twitterというものを使用していますが、前回と同じく、easy_installで入るものでなくtrunkにあるものを使用しています。
				作ってみて色々思ったこと
				
				結構行数が増えてきたので、Classにまとめようと思ったけど、次回チャレンジする
				Pythonで書いている人は文字列囲むのにダブルクォーテーションとシングルクォーテーションどちらなのか。もしくは使い分けしているのか
				変数命名が納得いかない。どうしたものか。
				自分で書いた英語がそもそも怪しい＞＜
				コードを書き始めてから、このblogを書き始めるまで１３時間くらいかかった。半年前だったら１週間以上かかっただろう。この進歩（牛歩だが）が嬉しい
				
				コードはこちら。Python2.6（MacOSX dmg）で動作確認は取れています。但しcronでの運用はまだ行っていません（先日セッティングした自鯖に入れるつもり）。
				
#!/usr/bin/env python
# coding: utf-8
#
# Please Note it.
# Python-twitter od the trunk version(r137 or higher)in necessary.
# svn checkout http://python-twitter.googlecode.com/svn/trunk/ python-twitter
#

import smtplib
from email.MIMEText import MIMEText
from email.Header import Header
from email.Utils import formatdate
import twitter
from datetime import *

TWITTER_USER = &#34;TWITTER_USER&#34;
TWITTER_PASSWD = &#34;TWITTER_PASSWARD&#34;
GMAIL_USER = &#34;GMAIL_ACCOUNT&#34;
GMAIL_PASSWD = &#34;GMAIL_PASSWARD&#34;
api = twitter.Api(TWITTER_USER, TWITTER_PASSWD)
FRIENDS_LIST = &#34;friends.txt&#34;
FOLLOWERS_LIST = &#34;followers.txt&#34;

def get_allfriends(): #friendを取得
    [...]]]></description>
			<content:encoded><![CDATA[				<p>GW期間に３連休（年に２回あるかどうか！というくらい貴重）をもらったので、Pythonのお勉強を兼ねてTwitter版<a href="http://www.atmarkit.co.jp/flinux/rensai/root04/root04c.html"></a>LogWatchのようなものを作ってみました。</p>
				<p><a class="" rel="" title="20090505_02" href="http://www.flickr.com/photos/aoshiman/3503817600/"><img src="http://static.flickr.com/3374/3503817600_a2f23125e6.jpg" alt="20090505_02"></a></p>
				<p><span id="more-312"></span><br />
				24時過ぎとかにcronで実行させると、FriendsとFollowersそれぞれのリストを前日に保存しておいたリストと照合し、追加した（された）および削除した（された）Friends/FollowersをリストアップしてGmailで自分宛に送信します。Twitter APIを扱うモジュールはPython-twitterというものを使用していますが、<a href="http://aoshiman.net/weblog/2009/04/17/python-twitter-in-3d-on-ubigraph/">前回</a>と同じく、easy_installで入るものでなくtrunkにあるものを使用しています。</p>
				<h3>作ってみて色々思ったこと</h3>
				<ul>
				<li>結構行数が増えてきたので、Classにまとめようと思ったけど、次回チャレンジする</li>
				<li>Pythonで書いている人は文字列囲むのにダブルクォーテーションとシングルクォーテーションどちらなのか。もしくは使い分けしているのか</li>
				<li>変数命名が納得いかない。どうしたものか。</li>
				<li>自分で書いた英語がそもそも怪しい＞＜</li>
				<li>コードを書き始めてから、このblogを書き始めるまで１３時間くらいかかった。半年前だったら１週間以上かかっただろう。この進歩（牛歩だが）が嬉しい</li>
				</ul>
				<p>コードはこちら。Python2.6（MacOSX dmg）で動作確認は取れています。但しcronでの運用はまだ行っていません（先日セッティングした自鯖に入れるつもり）。</p>
				<pre class="brush: python;">
#!/usr/bin/env python
# coding: utf-8
#
# Please Note it.
# Python-twitter od the trunk version(r137 or higher)in necessary.
# svn checkout http://python-twitter.googlecode.com/svn/trunk/ python-twitter
#

import smtplib
from email.MIMEText import MIMEText
from email.Header import Header
from email.Utils import formatdate
import twitter
from datetime import *

TWITTER_USER = &quot;TWITTER_USER&quot;
TWITTER_PASSWD = &quot;TWITTER_PASSWARD&quot;
GMAIL_USER = &quot;GMAIL_ACCOUNT&quot;
GMAIL_PASSWD = &quot;GMAIL_PASSWARD&quot;
api = twitter.Api(TWITTER_USER, TWITTER_PASSWD)
FRIENDS_LIST = &quot;friends.txt&quot;
FOLLOWERS_LIST = &quot;followers.txt&quot;

def get_allfriends(): #friendを取得
    friends, cnt = [], 1
    while not len(friends) % 100:
        friends += api.GetFriends(page=cnt)
        cnt += 1
    friend = []
    for i in friends:
        user = i.screen_name
        user = user + &quot;\n&quot;
        friend.append(user)
    return friend

def get_allfollowers(): #followerを取得
    followers, cnt = [], 1
    while not len(followers) % 100:
        followers += api.GetFollowers(page=cnt)
        cnt += 1
    follower = []
    for i in followers:
        user = i.screen_name
        user = user + &quot;\n&quot;
        follower.append(user)
    return follower

def flw_list_open(FOLLOWERS_LIST): #前回のfollowerリスト読込
    flw = open(FOLLOWERS_LIST, &quot;r&quot;)
    flw_list = flw.readlines()
    flw.close()
    return flw_list

def frd_list_open(FRIENDS_LIST): #前回のfriendリスト読込
    frd = open(FRIENDS_LIST, &quot;r&quot;)
    frd_list = frd.readlines()
    frd.close()
    return frd_list

def set_followers(): #followerリストのマッチング
    FLW, RMV = &quot;%(flws)s&quot;, &quot;%(rmv)s&quot;
    follower = get_allfollowers()
    flw_list = flw_list_open(FOLLOWERS_LIST)
    fl = open(FOLLOWERS_LIST, &quot;w&quot;)
    new_flw = []
    for flws in follower:
        if flws not in flw_list:
            new_flw.append(FLW % locals())
        fl.write(flws)

    rm_flw = []
    for rmv in flw_list:
        if rmv not in follower:
            rm_flw.append(RMV % locals())
    return new_flw, rm_flw, follower

def set_friends(): #friendリストのマッチング
    FRD, RMV = &quot;%(frds)s&quot;, &quot;%(rmv)s&quot;
    friend = get_allfriends()
    frd_list = frd_list_open(FRIENDS_LIST)
    fl = open(FRIENDS_LIST, &quot;w&quot;)
    new_frd = []
    for frds in friend:
        if frds not in frd_list:
            new_frd.append(FRD % locals())
        fl.write(frds)

    rm_frd = []
    for rmv in frd_list:
        if rmv not in friend:
            rm_frd.append(RMV % locals())
    return new_frd, rm_frd, friend

def create_message(from_addr, to_addr, subject, body, encoding):
    msg = MIMEText(body.encode(encoding), &quot;plain&quot;, encoding)
    msg[&quot;Subject&quot;] = Header(subject, encoding)
    msg[&quot;From&quot;] = from_addr
    msg = MIMEText(body.encode(encoding), &quot;plain&quot;, encoding)
    msg[&quot;Subject&quot;] = Header(subject, encoding)
    msg[&quot;From&quot;] = from_addr
    msg[&quot;To&quot;] = to_addr
    msg[&quot;Date&quot;] = formatdate()
    return msg

def send_via_gmail(from_addr, to_addr, msg):
    s = smtplib.SMTP(&quot;smtp.gmail.com&quot;, 587)
    s.ehlo()
    s.starttls()
    s.ehlo()
    s.login(GMAIL_USER, GMAIL_PASSWD)
    s.sendmail(from_addr, to_addr, msg.as_string())
    s.close()

def main():
    DATETIME = datetime.now()
    YESTERDAY = DATETIME + timedelta(hours=-24)
    DATESTR = DATETIME.strftime(&quot;%Y/%m/%d% %H:%M:%S&quot;)
    STR_YESTERDAY = YESTERDAY.strftime(&quot;%Y/%m/%d&quot;)

    subject = &quot;Logwatch for %s's Twitter&quot; % TWITTER_USER
    from_addr = GMAIL_USER
    to_addr = GMAIL_USER
    new_flw, rm_flw, follower = set_followers()
    new_frd, rm_frd, friend = set_friends()

    &quot;&quot;&quot;
    メールの本文にあたるところ
    もうちょっとうまく書けないものか
    あとそもそも英語があやしい
    &quot;&quot;&quot;
    body = &quot;################ Logwatch for %s's Twitter ################&quot; % TWITTER_USER + &quot;\n&quot;
    body += &quot;Processing Initiated:%s&quot; % DATESTR + &quot;\n&quot;
    body += &quot;Date Range Processed:%s&quot; % STR_YESTERDAY + &quot;\n&quot;
    body += &quot;Period is day.&quot; + &quot;\n&quot;
    body += &quot;\n&quot;
    body += &quot;--------------------- Followers Begin ---------------------&quot; + &quot;\n&quot;
    body += &quot;%s Users Followers&quot; % len(follower) + &quot;\n&quot;
    body += &quot;Followed by ...&quot; + &quot;\n&quot;
    if new_flw == []:
        body += &quot;Nobody followed you yesterday.&quot; + &quot;\n&quot;
    else:
        for nfl in new_flw:
            body += &quot;%s is followed you yesterday&quot; % nfl + &quot;\n&quot;
    body += &quot;Rmoved by ...&quot; + &quot;\n&quot;
    if rm_flw == []:
        body += &quot;Nobody Removed you yesterday.&quot; + &quot;\n&quot;
    else:
        for rfl in rm_flw:
            body += &quot;%s is Removed you yesterday&quot; % rfl + &quot;\n&quot;
    body += &quot;---------------------- Followers End ---------------------&quot; + &quot;\n&quot;
    body += &quot;\n&quot;
    body += &quot;--------------------- Friends Begin ---------------------&quot; + &quot;\n&quot;
    body += &quot;%s Users Friends&quot; % len(friend) + &quot;\n&quot;
    body += &quot;Following ...&quot; + &quot;\n&quot;
    if new_frd == []:
        body += &quot;No follow yesterday&quot; + &quot;\n&quot;
    else:
        for nfr in new_frd:
            body += &quot;following %s yesterday&quot; % nfr + &quot;\n&quot;
    body += &quot;Rmoving ...&quot; + &quot;\n&quot;
    if rm_frd == []:
        body += &quot;No Remove yesterday.&quot; + &quot;\n&quot;
    else:
        for rfr in rm_frd:
            body += &quot;Removing %s yesterday&quot; % rfr + &quot;\n&quot;
    body += &quot;---------------------- Friends End ---------------------&quot; + &quot;\n&quot;
    body += &quot;\n&quot;
    body += &quot;############## Logwatch for %s's Twitter End ##############&quot; % TWITTER_USER + &quot;\n&quot;
    msg = create_message(from_addr, to_addr, subject, body, &quot;utf-8&quot;)
    send_via_gmail(from_addr, to_addr, msg)

if __name__ == &quot;__main__&quot;:
    main()
</pre>
				<p>[2009年5月6日追記]<br />
				送られてきたメールを確認すると、改行されたくないところで改行されてたりするので、時間見つけて修正します。<br />
				[追記ここまで]</p>
				<p>[2009年6月20日追記]<br />
				最近Follower数がかなり少なくカウントされていると思っていて、時間がとれたので調べてみたんだけど、page=1が97になっていてカウントが止まってしまっている。100で割り切れなくなるまでカウントされるロジックなので、本当に97ならしかたがないのだけど、page=2にもFollowerがちゃんとある。調べた結果がこちら。うーん変だなあ・・</p>
				<pre class="brush: python;">
[root@centos ~]# python
Python 2.6.2 (r262:71600, May 14 2009, 20:12:16)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import twitter
&gt;&gt;&gt; api = twitter.Api('ACCOUNT', 'PASSWORD')
&gt;&gt;&gt; f = api.GetFollowers(page=2)
&gt;&gt;&gt; print len(f)
58
&gt;&gt;&gt; f = api.GetFollowers(page=1)
&gt;&gt;&gt; print len(f)
97
&gt;&gt;&gt; f = api.GetFollowers(page=3)
&gt;&gt;&gt; print len(f)
0
&gt;&gt;&gt;
</pre>
				<p>[追記ここまで]</p>
]]></content:encoded>
			<wfw:commentRss>http://aoshiman.net/weblog/2009/05/05/twitter_logwatch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>魚貝食事処　おがわ</title>
		<link>http://aoshiman.net/weblog/2009/05/02/shimizu_ogawa/</link>
		<comments>http://aoshiman.net/weblog/2009/05/02/shimizu_ogawa/#comments</comments>
		<pubDate>Sat, 02 May 2009 11:42:19 +0000</pubDate>
		<dc:creator>aoshiman</dc:creator>
				<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://aoshiman.net/weblog/?p=289</guid>
		<description><![CDATA[				
				
				午前で仕事を終わらせて嫁さんに会社までクルマで迎えにきてもらい、そのまま清水魚市場おさかなセンター　河岸の市へ食事に。お目当ての魚貝食事処　おがわは既に長蛇の列だったけど、せっかくなので４０分ほど待ちました。上の写真は、しみずみなと刺身定食というもので、これでもかとマグロのぶつ切りが盛ってあり、完食するのに一苦労。
				
				
				これは嫁さんが注文したネギトロ丼。
				お店で使用しているマグロは本マグロでなく、冷凍のバチマグロですが、個人的に大バチのトロが好みなので大満足でした。
				清水にお寄りの際は是非。
]]></description>
			<content:encoded><![CDATA[				<p><a title="P1030084" href="http://www.flickr.com/photos/aoshiman/3493037711/"><img src="http://static.flickr.com/3561/3493037711_b081667d75.jpg" alt="P1030084" /></a><br />
				<br />
				午前で仕事を終わらせて嫁さんに会社までクルマで迎えにきてもらい、そのまま<a href="http://www.at-s.com/bin/YELL/YELL0020.asp?id=C409259905">清水魚市場おさかなセンター　河岸の市</a>へ食事に。お目当ての<a href="http://gourmet.yahoo.co.jp/0004773273/M0022011640/">魚貝食事処　おがわ</a>は既に長蛇の列だったけど、せっかくなので４０分ほど待ちました。上の写真は、しみずみなと刺身定食というもので、これでもかとマグロの<span style="color: #ff0000;">ぶつ切り</span>が盛ってあり、完食するのに一苦労。<br />
				<span id="more-289"></span></p>
				<p><a class="" rel="" title="P1030082" href="http://www.flickr.com/photos/aoshiman/3493037359/"><img src="http://static.flickr.com/3414/3493037359_b6d0228fbc.jpg" alt="P1030082"></a></p>
				<p>これは嫁さんが注文したネギトロ丼。<br />
				お店で使用しているマグロは本マグロでなく、冷凍のバチマグロですが、個人的に大バチのトロが好みなので大満足でした。<br />
				清水にお寄りの際は是非。</p>
]]></content:encoded>
			<wfw:commentRss>http://aoshiman.net/weblog/2009/05/02/shimizu_ogawa/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

