<?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>ひろぽっぽれす &#187; 美人時計</title>
	<atom:link href="http://hiropo.co.uk/archives/category/%e7%be%8e%e4%ba%ba%e6%99%82%e8%a8%88/feed" rel="self" type="application/rss+xml" />
	<link>http://hiropo.co.uk</link>
	<description>Web系エンジニアの適当なブログです。どうでも酔いものばかり作ってます。</description>
	<lastBuildDate>Sun, 25 Jul 2010 17:09:15 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>美人時計のカワイイ子をまとめた動画をつくってみた</title>
		<link>http://hiropo.co.uk/archives/437</link>
		<comments>http://hiropo.co.uk/archives/437#comments</comments>
		<pubDate>Sat, 03 Apr 2010 18:14:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[美人時計]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=437</guid>
		<description><![CDATA[こんにちは。美人時計ネタです。 youtubeやニコ動でもよく見るのですが、動画編集をやってみたくて、美人時計のカワイイ子をまとめた動画をつくってみました。 ムービーメーカーむちゃくちゃ凄いです！ ※美人時計様、ご本人様からの削除要請がありましたら削除します。]]></description>
			<content:encoded><![CDATA[<p>こんにちは。美人時計ネタです。<br />
youtubeやニコ動でもよく見るのですが、動画編集をやってみたくて、美人時計のカワイイ子をまとめた動画をつくってみました。</p>
<p>ムービーメーカーむちゃくちゃ凄いです！</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/YF2jihCUPRQ&#038;hl=ja_JP&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/YF2jihCUPRQ&#038;hl=ja_JP&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>※美人時計様、ご本人様からの削除要請がありましたら削除します。</p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/437/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rubyでtwitterに投稿できるrubygems</title>
		<link>http://hiropo.co.uk/archives/429</link>
		<comments>http://hiropo.co.uk/archives/429#comments</comments>
		<pubDate>Sat, 13 Mar 2010 18:02:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[美人時計]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=429</guid>
		<description><![CDATA[美人時計の画像を毎日収集してる僕です、こんばんみ！ ▽関連記事 美人時計の全画像を取得するスクリプトをバッチ化してみた 毎日美人時計とGAL時計と美人時計（北海道版）の画像をウチのサーバちゃんが収集して差分まで比較して結果だけ教えてくれています。 収集Bot、かわいいよ、収集Bot。 そんな美人時計の差分が出たってのをtwitter経由で知らせてくれたらいいのに…と思いながら実装してみました。 がしかし…、twitterには140文字という投稿制限があるんですね、見事140文字オーバーしたら投稿できませんでしたよ。 とりあえず、Rubyでtwitterに投稿できるrubygemsのインストールの仕方です。 PLAIN TEXT CODE: rdocのインストール # yum install rdoc &#160; rubygemsのダウンロード #wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz &#160; rubygemsを解凍してインストール # tar xvfz rubygems-1.3.5.tgz # cd rubygems-1.3.5 # ruby setup.rb &#160; gemでtwitterをインストール % sudo gem install twitter Successfully installed twitter-0.8.4 1 gem installed Installing ri documentation for twitter-0.8.4... Installing RDoc documentation for twitter-0.8.4... [...]]]></description>
			<content:encoded><![CDATA[<p>美人時計の画像を毎日収集してる僕です、こんばんみ！</p>
<p>▽関連記事<br />
<a href="http://hiropo.co.uk/archives/331">美人時計の全画像を取得するスクリプトをバッチ化してみた</a></p>
<p>毎日美人時計とGAL時計と美人時計（北海道版）の画像をウチのサーバちゃんが収集して差分まで比較して結果だけ教えてくれています。<br />
収集Bot、かわいいよ、収集Bot。</p>
<p>そんな美人時計の差分が出たってのをtwitter経由で知らせてくれたらいいのに…と思いながら実装してみました。<br />
がしかし…、twitterには140文字という投稿制限があるんですね、見事140文字オーバーしたら投稿できませんでしたよ。</p>
<p>とりあえず、Rubyでtwitterに投稿できるrubygemsのインストールの仕方です。</p>
<div class="igBar"><span id="lcode-4"><a href="#" onclick="javascript:showCodeTxt('code-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-4">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">rdocのインストール</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># yum install rdoc</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">rubygemsのダウンロード</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#wget http:<span style="color:#FF9933; font-style:italic;">//rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">rubygemsを解凍してインストール</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># tar xvfz rubygems-<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">3</span>.<span style="color:#800000;color:#800000;">5</span>.<span style="">tgz</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># cd rubygems-<span style="color:#800000;color:#800000;">1</span>.<span style="color:#800000;color:#800000;">3</span>.<span style="color:#800000;color:#800000;">5</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># ruby setup.<span style="">rb</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">gemでtwitterをインストール</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">% sudo gem install twitter</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Successfully installed twitter-<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">8</span>.<span style="color:#800000;color:#800000;">4</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">1</span> gem installed</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Installing ri documentation for twitter-<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">8</span>.<span style="color:#800000;color:#800000;">4</span>...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">Installing</span> RDoc documentation for twitter-<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">8</span>.<span style="color:#800000;color:#800000;">4</span>... </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>こんな感じでサーバーにインストール。そしてRubyの書き方は下記の通り。</p>
<div class="igBar"><span id="lruby-5"><a href="#" onclick="javascript:showCodeTxt('ruby-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-5">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;"># ./twit.rb</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> twit<span style="color:#006600; font-weight:bold;">&#40;</span> v <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000; font-style:italic;">#------------------------------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000; font-style:italic;"># twitter gems をインポート</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">require</span> 'rubygems'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">require</span> 'twitter'</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000; font-style:italic;">#------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000; font-style:italic;"># Rubyから投稿</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; twit_username = 'アカウント名'</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; twit_password = 'ログインパスワード'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; auth = Twitter::HTTPAuth.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span> twit_username, twit_password <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; twit = Twitter::Base.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span> auth <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; twit.<span style="color:#9900CC;">update</span><span style="color:#006600; font-weight:bold;">&#40;</span> v <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">p</span> 'twit!!'</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000; font-style:italic;">#------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">twit<span style="color:#006600; font-weight:bold;">&#40;</span> 'てすつ投稿やねん' <span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>コマンドラインでプログラムを実行する。</p>
<div class="igBar"><span id="lcode-6"><a href="#" onclick="javascript:showCodeTxt('code-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-6">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">host~% ruby ./twit.<span style="">rb</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>これでRubyからtwitterに投稿できちゃう！Ruby、簡単だよ、Ruby。</p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/429/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>美人時計のデジタルフォトフレーム版を作ってみた。 &#8211; DPF-D72N</title>
		<link>http://hiropo.co.uk/archives/425</link>
		<comments>http://hiropo.co.uk/archives/425#comments</comments>
		<pubDate>Mon, 01 Mar 2010 16:46:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[hack]]></category>
		<category><![CDATA[美人時計]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=425</guid>
		<description><![CDATA[デジタルフォトフレームに美人時計をいれてみた。 スライドショーで、1分置きに画像を切り替えるようにしてみたので、スタートを現在の時間にすることによって、美人時計のデジタルフォトフレーム版が完成！もちろん1440枚全部入ってますよ！ 我ながらよくやるわと思った。]]></description>
			<content:encoded><![CDATA[<p>デジタルフォトフレームに美人時計をいれてみた。</p>
<p><a href="http://hiropo.co.uk/wp-content/uploads/2010/03/IMG_3448.jpg"><img src="http://hiropo.co.uk/wp-content/uploads/2010/03/IMG_3448.jpg" alt="" title="IMG_3448" width="640" height="426" class="alignnone size-full wp-image-426" /></a></p>
<p>スライドショーで、1分置きに画像を切り替えるようにしてみたので、スタートを現在の時間にすることによって、美人時計のデジタルフォトフレーム版が完成！もちろん1440枚全部入ってますよ！</p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/q2llpaxMDbY&#038;hl=ja_JP&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/q2llpaxMDbY&#038;hl=ja_JP&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p>我ながらよくやるわと思った。</p>
<p><iframe src="http://rcm-jp.amazon.co.jp/e/cm?lt1=_blank&#038;bc1=FFFFFF&#038;IS2=1&#038;npa=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=funnythingz-22&#038;o=9&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;asins=B002TO4N3K" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/425/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>【美人時計】ニコニコ踊り娘 &#8211; ミンカ、Ire、いとくとら、まころん、馬琴</title>
		<link>http://hiropo.co.uk/archives/367</link>
		<comments>http://hiropo.co.uk/archives/367#comments</comments>
		<pubDate>Sat, 30 Jan 2010 17:05:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[美人時計]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=367</guid>
		<description><![CDATA[ウチのサーバちゃんが相変わらず今もなお毎日美人時計の画像を収集している。今ではGAL時計も毎日収集していて、相変わらず差分のみちゃっかり保存しちゃってます。キモイね！ そんな美人時計の登場人物の差分をみていたんですけど、去年くらいまでは女の子が純粋に更新されいたっぽいんですが、最近はドラマや企業や企画モノなどとコラボして、画像が更新されている傾向にありますね。 そんなところでまずはニコニコ動画で有名（？）な踊り子とのコラボを紹介します。 上の列から、ミンカ、Ire、いとくとら、まころん、馬琴。 うん、みんな可愛いすぎるすな！]]></description>
			<content:encoded><![CDATA[<p>ウチのサーバちゃんが相変わらず今もなお毎日美人時計の画像を収集している。今ではGAL時計も毎日収集していて、相変わらず差分のみちゃっかり保存しちゃってます。キモイね！</p>
<p>そんな美人時計の登場人物の差分をみていたんですけど、去年くらいまでは女の子が純粋に更新されいたっぽいんですが、最近はドラマや企業や企画モノなどとコラボして、画像が更新されている傾向にありますね。</p>
<p>そんなところでまずはニコニコ動画で有名（？）な踊り子とのコラボを紹介します。</p>
<p>上の列から、ミンカ、Ire、いとくとら、まころん、馬琴。<br />

<a href='http://hiropo.co.uk/archives/367/attachment/2008' title='2008'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20081-150x150.jpg" class="attachment-thumbnail" alt="2008" title="2008" /></a>
<a href='http://hiropo.co.uk/archives/367/2009-2' title='2009'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20092-150x150.jpg" class="attachment-thumbnail" alt="2009" title="2009" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2010' title='2010'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20101-150x150.jpg" class="attachment-thumbnail" alt="2010" title="2010" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2011' title='2011'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20111-150x150.jpg" class="attachment-thumbnail" alt="2011" title="2011" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2020' title='2020'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20201-150x150.jpg" class="attachment-thumbnail" alt="2020" title="2020" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2021' title='2021'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20211-150x150.jpg" class="attachment-thumbnail" alt="2021" title="2021" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2022' title='2022'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20221-150x150.jpg" class="attachment-thumbnail" alt="2022" title="2022" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2023' title='2023'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20231-150x150.jpg" class="attachment-thumbnail" alt="2023" title="2023" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2004' title='2004'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20042-150x150.jpg" class="attachment-thumbnail" alt="2004" title="2004" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2005' title='2005'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20051-150x150.jpg" class="attachment-thumbnail" alt="2005" title="2005" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2006' title='2006'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20061-150x150.jpg" class="attachment-thumbnail" alt="2006" title="2006" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2007' title='2007'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20072-150x150.jpg" class="attachment-thumbnail" alt="2007" title="2007" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2040' title='2040'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20401-150x150.jpg" class="attachment-thumbnail" alt="2040" title="2040" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2041' title='2041'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20411-150x150.jpg" class="attachment-thumbnail" alt="2041" title="2041" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2042' title='2042'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20421-150x150.jpg" class="attachment-thumbnail" alt="2042" title="2042" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2043' title='2043'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20431-150x150.jpg" class="attachment-thumbnail" alt="2043" title="2043" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2016' title='2016'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20161-150x150.jpg" class="attachment-thumbnail" alt="2016" title="2016" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2017' title='2017'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20171-150x150.jpg" class="attachment-thumbnail" alt="2017" title="2017" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2018' title='2018'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20181-150x150.jpg" class="attachment-thumbnail" alt="2018" title="2018" /></a>
<a href='http://hiropo.co.uk/archives/367/attachment/2019' title='2019'><img width="150" height="150" src="http://hiropo.co.uk/wp-content/uploads/2010/01/20191-150x150.jpg" class="attachment-thumbnail" alt="2019" title="2019" /></a>
</p>
<p>うん、みんな可愛いすぎるすな！</p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/367/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>美人時計で画像を収集する際に使った計算式</title>
		<link>http://hiropo.co.uk/archives/360</link>
		<comments>http://hiropo.co.uk/archives/360#comments</comments>
		<pubDate>Wed, 27 Jan 2010 09:31:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[美人時計]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=360</guid>
		<description><![CDATA[美人時計の画像を収集する際に、時間で画像名が吐き出されているので、その吐き出しの計算式をおこしてみた。 画像収集バッチはRubyなんですが、今回ちょっとJavaScriptを使う機会があったので、JavaScriptで起こしてみました。 PLAIN TEXT HTML: &#60;div id="debug"&#62;&#60;/div&#62; PLAIN TEXT JavaScript: &#40;function&#40;&#41;&#123; &#160; var getid = function&#40;id&#41;&#123; &#160; &#160; return document.getElementById&#40;id&#41;; &#160; &#125; &#160; var debug = getid&#40; 'debug' &#41;; &#160; var dateCount = function&#40;arg&#41;&#123; &#160; &#160; return arg; &#160; &#125; &#160; for&#40; var i = 0; i &#60;24; i++ &#41;&#123; &#160; &#160; for&#40; var j [...]]]></description>
			<content:encoded><![CDATA[<p>美人時計の画像を収集する際に、時間で画像名が吐き出されているので、その吐き出しの計算式をおこしてみた。<br />
画像収集バッチはRubyなんですが、今回ちょっとJavaScriptを使う機会があったので、JavaScriptで起こしてみました。</p>
<div class="igBar"><span id="lhtml-9"><a href="#" onclick="javascript:showCodeTxt('html-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-9">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"debug"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="ljavascript-10"><a href="#" onclick="javascript:showCodeTxt('javascript-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-10">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> getid = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>id<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span>id<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> debug = getid<span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">'debug'</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> dateCount = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>arg<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> arg;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> i = <span style="color: #CC0000;color:#800000;">0</span>; i &lt;<span style="color: #CC0000;color:#800000;">24</span>; i++ <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> j = <span style="color: #CC0000;color:#800000;">0</span>; j &lt;<span style="color: #CC0000;color:#800000;">60</span>; j++ <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> i &lt;<span style="color: #CC0000;color:#800000;">10</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> j &lt;<span style="color: #CC0000;color:#800000;">10</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debug.<span style="color: #006600;">innerHTML</span> += <span style="color: #3366CC;">'0'</span> + i.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">'0'</span> + j.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">'.jpg'</span> + <span style="color: #3366CC;">'&lt;br /&gt;'</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debug.<span style="color: #006600;">innerHTML</span> += <span style="color: #3366CC;">'0'</span> + i.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + j.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">'.jpg'</span> + <span style="color: #3366CC;">'&lt;br /&gt;'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span> j &lt;<span style="color: #CC0000;color:#800000;">10</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debug.<span style="color: #006600;">innerHTML</span> += i.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">'0'</span> + j.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">'.jpg'</span> + <span style="color: #3366CC;">'&lt;br /&gt;'</span>;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debug.<span style="color: #006600;">innerHTML</span> += i.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + j.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">'.jpg'</span> + <span style="color: #3366CC;">'&lt;br /&gt;'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>0000.jpg<br />
0001.jpg<br />
～略～<br />
2358.jpg<br />
2359.jpg</p>
<p>まで表示されます。</p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/360/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>美人時計のGAL時計に若槻千夏が登場してた。</title>
		<link>http://hiropo.co.uk/archives/348</link>
		<comments>http://hiropo.co.uk/archives/348#comments</comments>
		<pubDate>Sun, 03 Jan 2010 16:27:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[美人時計]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=348</guid>
		<description><![CDATA[あけおめです！今年もがしがし開発していくんでよろしくです。（なにを？） 前回書いた美人時計の画像取得スクリプトのCron化、GAL時計もはじめてみました。 ▽GAL時計 http://www.bijint.com/ 毎日0時にGAL時計の画像を収集し、2時に美人時計の画像を収集します。収集したからといって特に見ることなくツールつくっただけで満足しちゃってます。 ただ毎日画像を収集していると、1日あたり400MB近く画像がたまっていくので、差分だけをHDDに残すようにしようと思い、比較差分のツールもつくりました。 ただ単にマスターと今日落とした分のmd5を比較して、差分を別フォルダに保存するだけです。 PLAIN TEXT RUBY: #------------------------------------------------------------ #&#160; ライブラリのインポート # require 'digest/md5' require './ooiwa_frame_work' &#160; $scriptPath = './gal_tokei/' $targetDir = getTimeNow&#40;0&#41; + '_gal' $todayDir = $scriptPath + $targetDir &#160; #------------------------------------------------------------ #&#160; 前日と当日を比較するための関数 # def hikaku&#40; before, after &#41; &#160; &#160; #------------------------------------------------------------ &#160; &#160; #&#160; 前日の画像フォルダと、当日の画像フォルダから、 &#160; &#160; #&#160; 画像リストを配列に代入 &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>あけおめです！今年もがしがし開発していくんでよろしくです。（なにを？）<br />
前回書いた美人時計の画像取得スクリプトのCron化、GAL時計もはじめてみました。</p>
<p>▽GAL時計<br />
<a href="http://www.bijint.com/" target="_blank">http://www.bijint.com/</a></p>
<p>毎日0時にGAL時計の画像を収集し、2時に美人時計の画像を収集します。収集したからといって特に見ることなくツールつくっただけで満足しちゃってます。<br />
ただ毎日画像を収集していると、1日あたり400MB近く画像がたまっていくので、差分だけをHDDに残すようにしようと思い、比較差分のツールもつくりました。<br />
ただ単にマスターと今日落とした分のmd5を比較して、差分を別フォルダに保存するだけです。</p>
<div class="igBar"><span id="lruby-12"><a href="#" onclick="javascript:showCodeTxt('ruby-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-12">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#&nbsp; ライブラリのインポート</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">require</span> 'digest/md5'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">require</span> './ooiwa_frame_work'</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$scriptPath = './gal_tokei/'</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$targetDir = getTimeNow<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> + '_gal'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$todayDir = $scriptPath + $targetDir</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#&nbsp; 前日と当日を比較するための関数</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> hikaku<span style="color:#006600; font-weight:bold;">&#40;</span> before, after <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000; font-style:italic;">#------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000; font-style:italic;">#&nbsp; 前日の画像フォルダと、当日の画像フォルダから、</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000; font-style:italic;">#&nbsp; 画像リストを配列に代入</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000; font-style:italic;">#</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; beforeList = Dir::entries<span style="color:#006600; font-weight:bold;">&#40;</span> before <span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_s</span>.<span style="color:#CC0066; font-weight:bold;">gsub</span><span style="color:#006600; font-weight:bold;">&#40;</span>'...'<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span>''<span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#CC0066; font-weight:bold;">gsub</span><span style="color:#006600; font-weight:bold;">&#40;</span> /g<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;color:#800000;">0</span>-<span style="color:#006666;color:#800000;">9</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>/ <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span> 'g ' + $<span style="color:#006666;color:#800000;">1</span> <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span>' '<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">sort</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; diffList = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; beforeList.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> |val|</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; rb = Digest::MD5.<span style="color:#9900CC;">hexdigest</span><span style="color:#006600; font-weight:bold;">&#40;</span> File.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span> before + val, 'rb' <span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">read</span> <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ra = Digest::MD5.<span style="color:#9900CC;">hexdigest</span><span style="color:#006600; font-weight:bold;">&#40;</span> File.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span> after + val, 'rb' <span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">read</span> <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> rb === ra</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000; font-style:italic;"># 処理なし</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">else</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FileUtils.<span style="color:#9900CC;">cp</span><span style="color:#006600; font-weight:bold;">&#40;</span> after + val, $todayDir + '_diff/' + val <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; diffList.<span style="color:#9900CC;">push</span><span style="color:#006600; font-weight:bold;">&#40;</span> val <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000; font-style:italic;"># 差分リストの書き出し</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> put_list<span style="color:#006600; font-weight:bold;">&#40;</span> diffList, $scriptPath + 'log/' + $targetDir + '_list.<span style="color:#9900CC;">txt</span>' <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">print</span> 'GAL時計の差分ファイルログを<span style="color:#996600;">"' + $targetDir + '_list.txt"</span>' + 'に書き出しました。'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">print</span> <span style="color:#996600;">"<span style="color:#000099;">\n</span>"</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">true</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>上記のスクリプトはサンプルです。実際には、上記スクリプトのhikakuメソッドを使用して、差分のみを当日フォルダに保存するといった処理をかましています。<br />
ちなみに "ooiwa_frame_work" という謎の自作ライブラリをかましてるので、コピペだけじゃ動かないかも。（意味なし。）</p>
<p>オマケに若槻千夏の画像でも。</p>
<p>0：00<br />
<img src="http://hiropo.co.uk/wp-content/uploads/2010/01/0000-300x228.jpg" alt="0000" title="0000" width="300" height="228" class="alignnone size-medium wp-image-349" /></p>
<p>18：00<br />
<img src="http://hiropo.co.uk/wp-content/uploads/2010/01/1800-300x228.jpg" alt="1800" title="1800" width="300" height="228" class="alignnone size-medium wp-image-350" /></p>
<p>この美人時計とかGAL時計、けっこうコラボしてるんだよねー。美人時計に出てる娘とかも、ニコニコ動画で有名な踊ってる娘がいたりとか、けっこう収集してて面白いよね。</p>
<p>何か最近、こずえちゃんとミンカちゃんとかとユニットを組んだらしい「いといくら」こといくらちゃん。<br />
可愛過ぎるわ。<br />
<script type="text/javascript" src="http://ext.nicovideo.jp/thumb_watch/sm4146159"></script><noscript><a href="http://www.nicovideo.jp/watch/sm4146159">【ニコニコ動画】キラッ☆星間飛行を踊ってみた＠いとくとら</a></noscript></p>
<p>いくらちゃんの美人時計<br />
<img src="http://hiropo.co.uk/wp-content/uploads/2010/01/2004-300x228.jpg" alt="2004" title="2004" width="300" height="228" class="alignnone size-medium wp-image-351" /><br />
<img src="http://hiropo.co.uk/wp-content/uploads/2010/01/2007-300x228.jpg" alt="2007" title="2007" width="300" height="228" class="alignnone size-medium wp-image-352" /></p>
<p>むっちゃくちゃ可愛いですお（＾ｑ＾）オレの方が可愛いけどなっ！</p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/348/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>美人時計の全画像を取得するスクリプトをバッチ化してみた</title>
		<link>http://hiropo.co.uk/archives/331</link>
		<comments>http://hiropo.co.uk/archives/331#comments</comments>
		<pubDate>Fri, 20 Nov 2009 02:18:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[美人時計]]></category>

		<guid isPermaLink="false">http://hiropo.co.uk/?p=331</guid>
		<description><![CDATA[最近流行り（？）の美人時計。Web業界の人間ならだいたいの人は知っているんじゃないでしょうかね。1分置きに女の子が変わるというこのサービス。女の子が変わるまでずーっと24時間も待っていられないので、全画像を取得するスクリプトをつくってしまいたくなりました。 とりあえず誰かすでにつくってるんじゃないだろうかと思い、google先生にきいてみました。 案の定すぐみつかりましたよ！素敵スクリプトをつくっている方が！ ▽こちら 『Yamashiro0217の日記』 Rubyで組まれているようです。僕はPHP派なので、Rubyまったくわかりませんが、この際Rubyに入門してしまおう！ってことで、Yamashiro0217さんのスクリプトを参考にスクリプトをつくってみようと思います。 まずはRubyスクリプトの動作確認 Yamashiro0217さんのスクリプトをコピペで動かしてみます。 ▽開発環境 Fedora10のインストールされたLinuxサーバ。 Rubyはすでにインストール済み。 ▽美人時計の全画像取得スクリプト bijin.ruby PLAIN TEXT RUBY: require 'net/http' require 'uri' &#160; error_files = "" 0..24.times do &#124;hour&#124; &#160; &#160;0..60.times do &#124;minute&#124; &#160; &#160; &#160; now_hour = sprintf&#40;"%0#{2}d", hour&#41; &#160; &#160; &#160; now_minute = sprintf&#40;"%0#{2}d", minute&#41; &#160; &#160; &#160; sleep 1 &#160; &#160; &#160; begin &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>最近流行り（？）の<a href="http://www.bijint.com/jp/" target="_blank">美人時計</a>。Web業界の人間ならだいたいの人は知っているんじゃないでしょうかね。1分置きに女の子が変わるというこのサービス。女の子が変わるまでずーっと24時間も待っていられないので、全画像を取得するスクリプトをつくってしまいたくなりました。</p>
<p>とりあえず誰かすでにつくってるんじゃないだろうかと思い、google先生にきいてみました。</p>
<p>案の定すぐみつかりましたよ！素敵スクリプトをつくっている方が！</p>
<p>▽こちら<br />
『<a href="http://d.hatena.ne.jp/Yamashiro0217/20090930/1254305886" target="_blank">Yamashiro0217の日記</a>』</p>
<p>Rubyで組まれているようです。僕はPHP派なので、Rubyまったくわかりませんが、この際Rubyに入門してしまおう！ってことで、Yamashiro0217さんのスクリプトを参考にスクリプトをつくってみようと思います。</p>
<p>まずはRubyスクリプトの動作確認<br />
Yamashiro0217さんのスクリプトをコピペで動かしてみます。</p>
<p>▽開発環境<br />
Fedora10のインストールされたLinuxサーバ。<br />
Rubyはすでにインストール済み。</p>
<p>▽美人時計の全画像取得スクリプト<br />
bijin.ruby</p>
<div class="igBar"><span id="lruby-20"><a href="#" onclick="javascript:showCodeTxt('ruby-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-20">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">require</span> 'net/http'</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">require</span> 'uri'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">error_files = <span style="color:#996600;">""</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006666;color:#800000;">0</span>..<span style="color:#006666;color:#800000;">24</span>.<span style="color:#9900CC;">times</span> <span style="color:#9966CC; font-weight:bold;">do</span> |hour|</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#006666;color:#800000;">0</span>..<span style="color:#006666;color:#800000;">60</span>.<span style="color:#9900CC;">times</span> <span style="color:#9966CC; font-weight:bold;">do</span> |minute|</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; now_hour = <span style="color:#CC0066; font-weight:bold;">sprintf</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">"%0#{2}d"</span>, hour<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; now_minute = <span style="color:#CC0066; font-weight:bold;">sprintf</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">"%0#{2}d"</span>, minute<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">sleep</span> <span style="color:#006666;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">begin</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Net::HTTP.<span style="color:#9900CC;">start</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">"bijint.com"</span>, <span style="color:#006666;color:#800000;">80</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> |http|</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;response = http.<span style="color:#9900CC;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#996600;">"/jp/img/clk/#{now_hour}#{now_minute}.jpg"</span>,</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#996600;">"Referer"</span> =&gt; <span style="color:#996600;">"http://bijint.com/jp/"</span> <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#996600;">"#{now_hour}#{now_minute}.jpg"</span>, <span style="color:#996600;">"wb"</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> |file|</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;file.<span style="color:#CC0066; font-weight:bold;">puts</span> response.<span style="color:#9900CC;">body</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">rescue</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#996600;">"#{now_hour}#{now_minute}.jpg can not get"</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;error_files += <span style="color:#996600;">"http://bijint.com/jp/img/clk/#{now_hour}#{now_minute}.jpg<span style="color:#000099;">\n</span>"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>▽コマンドから実行</p>
<div class="igBar"><span id="lcode-21"><a href="#" onclick="javascript:showCodeTxt('code-21'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-21">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>ooiwa@eva bijin_tokei<span style="color:#006600; font-weight:bold;">&#93;</span>$ ruby bijin.<span style="">ruby</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>おぉー！画像がどんどん落ちてきたよー！これは感動！とりあえず動作確認はOKと。</p>
<p>ただこの美人時計、落とした画像ファイルと、本番サイトの美人時計側で女の子の表示が違うときがあります。どうやら日々ちょこちょこ女の子が更新されているようです。これはなんということ！全女の子コンプリートするには定期的にチェックするしかないじゃないか！ということで、この際毎日取得してしまうスクリプトを組んでみようと思います。</p>
<p>それではバッチをつくっていきます。<br />
定期的に1日毎に決まった時間に全画像を取得して、なおかつ日付ごとにディレクトリを分けて保存する、バッチをまわすのはCron、スクリプト言語はRubyをつかってつくっていきます。</p>
<p>まず、Yamashiro0217さんのスクリプトをこのまま使うと、スクリプトと同じパスに画像をそのままダウンロードしてきますので、日付毎にディレクトリを切ってくれる関数を用意します。<br />
今回はわかりやすいようにスクリプトを起動した日の日付を取得して"yyyymmdd"形式で文字列を返す関数と、ディレクトリを生成する関数を用意します。</p>
<p>▽今日の日付をyyyymmdd型の文字列に変換する関数</p>
<div class="igBar"><span id="lruby-22"><a href="#" onclick="javascript:showCodeTxt('ruby-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-22">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> getTimeNow<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; day = Time.<span style="color:#9900CC;">now</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; putMonth = day.<span style="color:#9900CC;">month</span>.<span style="color:#9900CC;">to_s</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; putDay = day.<span style="color:#9900CC;">day</span>.<span style="color:#9900CC;">to_s</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> day.<span style="color:#9900CC;">month</span> &lt;<span style="color:#006666;color:#800000;">10</span> &amp;&amp; day.<span style="color:#9900CC;">day</span> &lt;<span style="color:#006666;color:#800000;">10</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; putMonth = '<span style="color:#006666;color:#800000;">0</span>' + day.<span style="color:#9900CC;">month</span>.<span style="color:#9900CC;">to_s</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; putDay = '<span style="color:#006666;color:#800000;">0</span>' + day.<span style="color:#9900CC;">day</span>.<span style="color:#9900CC;">to_s</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">elsif</span> day.<span style="color:#9900CC;">month</span> &lt;<span style="color:#006666;color:#800000;">10</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; putMonth = '<span style="color:#006666;color:#800000;">0</span>' + day.<span style="color:#9900CC;">month</span>.<span style="color:#9900CC;">to_s</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">elsif</span> day.<span style="color:#9900CC;">day</span> &lt;<span style="color:#006666;color:#800000;">10</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; putDay = '<span style="color:#006666;color:#800000;">0</span>' + day.<span style="color:#9900CC;">day</span>.<span style="color:#9900CC;">to_s</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; nowTime = day.<span style="color:#9900CC;">year</span>.<span style="color:#9900CC;">to_s</span> + putMonth + putDay</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> nowTime</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>▽ディレクトリの生成</p>
<div class="igBar"><span id="lruby-23"><a href="#" onclick="javascript:showCodeTxt('ruby-23'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-23">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> mkdir<span style="color:#006600; font-weight:bold;">&#40;</span>path<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> Dir::mkdir<span style="color:#006600; font-weight:bold;">&#40;</span> path, <span style="color:#006666;color:#800000;">0777</span> <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">true</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">else</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>あとは、Yamashiro0217さんのスクリプトにディレクトリパスを突っ込んで、一通り完成させる。今回Cronでバッチ処理させるため、ディレクトリパスは絶対パスで書く。</p>
<p>▽スクリプトをまとめたのがこれ<br />
bijin.ruby</p>
<div class="igBar"><span id="lruby-24"><a href="#" onclick="javascript:showCodeTxt('ruby-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-24">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#――――――――――――――――――――――――――――――</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#&nbsp; 美人時計の画像を全取得するスクリプト</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#------------------------------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#&nbsp; ライブラリのインポート</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">require</span> 'net/http'</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">require</span> 'uri'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#------------------------------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#&nbsp; Global var</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$scriptPath = 'bijin_tokei/'</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">p</span> $scriptPath</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#&nbsp; 今日の日付をyyyymmdd型の文字列に変換する関数</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> getTimeNow<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; day = Time.<span style="color:#9900CC;">now</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; putMonth = day.<span style="color:#9900CC;">month</span>.<span style="color:#9900CC;">to_s</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; putDay = day.<span style="color:#9900CC;">day</span>.<span style="color:#9900CC;">to_s</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> day.<span style="color:#9900CC;">month</span> &lt;<span style="color:#006666;color:#800000;">10</span> &amp;&amp; day.<span style="color:#9900CC;">day</span> &lt;<span style="color:#006666;color:#800000;">10</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; putMonth = '<span style="color:#006666;color:#800000;">0</span>' + day.<span style="color:#9900CC;">month</span>.<span style="color:#9900CC;">to_s</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; putDay = '<span style="color:#006666;color:#800000;">0</span>' + day.<span style="color:#9900CC;">day</span>.<span style="color:#9900CC;">to_s</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">elsif</span> day.<span style="color:#9900CC;">month</span> &lt;<span style="color:#006666;color:#800000;">10</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; putMonth = '<span style="color:#006666;color:#800000;">0</span>' + day.<span style="color:#9900CC;">month</span>.<span style="color:#9900CC;">to_s</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">elsif</span> day.<span style="color:#9900CC;">day</span> &lt;<span style="color:#006666;color:#800000;">10</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; putDay = '<span style="color:#006666;color:#800000;">0</span>' + day.<span style="color:#9900CC;">day</span>.<span style="color:#9900CC;">to_s</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; nowTime = day.<span style="color:#9900CC;">year</span>.<span style="color:#9900CC;">to_s</span> + putMonth + putDay</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> nowTime</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0066; font-weight:bold;">p</span> getTimeNow<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#&nbsp; ディレクトリの生成</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> mkdir<span style="color:#006600; font-weight:bold;">&#40;</span>path<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> Dir::mkdir<span style="color:#006600; font-weight:bold;">&#40;</span> path, <span style="color:#006666;color:#800000;">0777</span> <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">true</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">else</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#&nbsp; 美人時計から画像を取得</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> getBijin<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; error_files = <span style="color:#996600;">""</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006666;color:#800000;">0</span>..<span style="color:#006666;color:#800000;">24</span>.<span style="color:#9900CC;">times</span> <span style="color:#9966CC; font-weight:bold;">do</span> |hour|</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; <span style="color:#006666;color:#800000;">0</span>..<span style="color:#006666;color:#800000;">60</span>.<span style="color:#9900CC;">times</span> <span style="color:#9966CC; font-weight:bold;">do</span> |minute|</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;now_hour = <span style="color:#CC0066; font-weight:bold;">sprintf</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">"%0#{2}d"</span>, hour<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;now_minute = <span style="color:#CC0066; font-weight:bold;">sprintf</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">"%0#{2}d"</span>, minute<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#CC0066; font-weight:bold;">sleep</span> <span style="color:#006666;color:#800000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#9966CC; font-weight:bold;">begin</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Net::HTTP.<span style="color:#9900CC;">start</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">"bijint.com"</span>, <span style="color:#006666;color:#800000;">80</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> |http|</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; response = http.<span style="color:#9900CC;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">"/jp/img/clk/#{now_hour}#{now_minute}.jpg"</span>,</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#996600;">"Referer"</span> =&gt; <span style="color:#996600;">"http://bijint.com/jp/"</span> <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span> $scriptPath + getTimeNow<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#996600;">"/#{now_hour}#{now_minute}.jpg"</span>, <span style="color:#996600;">"wb"</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> |file|</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; file.<span style="color:#CC0066; font-weight:bold;">puts</span> response.<span style="color:#9900CC;">body</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#9966CC; font-weight:bold;">rescue</span> </div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#996600;">"#{now_hour}#{now_minute}.jpg can not get"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error_files += <span style="color:#996600;">"http://bijint.com/jp/img/clk/#{now_hour}#{now_minute}.jpg<span style="color:#000099;">\n</span>"</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#&nbsp; 初期実行関数</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000; font-style:italic;">#</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> init<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; targetDir = $scriptPath + getTimeNow<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> File.<span style="color:#9900CC;">exists</span>?<span style="color:#006600; font-weight:bold;">&#40;</span> targetDir <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; getBijin<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">else</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> mkdir<span style="color:#006600; font-weight:bold;">&#40;</span> targetDir <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">p</span> 'make!'</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; getBijin<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">init<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Rubyは変数の定義がグローバルとローカルでスコープがわかりやすいから良いですね！なんかPHPより全然カンタンだし、オブジェクト指向言語だし、個人的にはだいぶ気に入りました。</p>
<p>完成したスクリプトを早速実行してみます。</p>
<div class="igBar"><span id="lcode-25"><a href="#" onclick="javascript:showCodeTxt('code-25'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-25">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>ooiwa@eva bijin_tokei<span style="color:#006600; font-weight:bold;">&#93;</span>$ ruby /home/ooiwa/tmp_ruby/bijin_tokei/bijin.<span style="">ruby</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>ooiwa@eva bijin_tokei<span style="color:#006600; font-weight:bold;">&#93;</span>$ ls</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">20091120</span>&nbsp; bijin.<span style="">ruby</span></div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>ooiwa@eva bijin_tokei<span style="color:#006600; font-weight:bold;">&#93;</span>$ ls <span style="color:#800000;color:#800000;">20091120</span>/</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">0000</span>.<span style="">jpg</span> <span style="color:#800000;color:#800000;">0001</span>.<span style="">jpg</span> <span style="color:#800000;color:#800000;">0002</span>.<span style="">jpg</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>うまく動いていれば、本日の日付ディレクトリが生成され、そのディレクトリの中に画像をどんどんたまっていっているのがわかります。</p>
<p>最後はこの完成したスクリプトをCronでまわす処理をします。</p>
<div class="igBar"><span id="lcode-26"><a href="#" onclick="javascript:showCodeTxt('code-26'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-26">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>ooiwa@eva bijin_tokei<span style="color:#006600; font-weight:bold;">&#93;</span>$ crontab -e</div>
</li>
<li style="font-weight: bold;color:IG_LINE_COLOUR_2;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#毎日<span style="color:#800000;color:#800000;">10</span>:<span style="color:#800000;color:#800000;">00</span>に bijin.<span style="">ruby</span> スクリプトを実行</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:IG_LINE_COLOUR_1;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">0</span> <span style="color:#800000;color:#800000;">10</span> * * * ruby /home/ooiwa/tmp_ruby/bijin_tokei/bijin.<span style="">ruby</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>あとは毎日10時になるとCronがRubyスクリプトを実行してくれます。<br />
これであとは目視で比較するか、md5で比較するツールでもつくって差分を分けるスクリプトを足すかでもすればどの女の子が削除されて追加されたかがわかりますね。</p>
<p>美人時計、面白いです。</p>
]]></content:encoded>
			<wfw:commentRss>http://hiropo.co.uk/archives/331/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
