2010-04-25 (日) 1282steps [長年日記]
_ エバーグリーン、1,999円の2入力HDMIセレクタ
8入力はなかなか壮観だな。
_ 今日の購入
_ 日記へのTwitterでの「つぶやかれ数」を表示するようにした
ReTweetした際にエントリのタイトルが入らないようだったので、少し改造してみた。
--- retweet.rb.orig 2010-04-25 23:59:12.000000000 +0900
+++ retweet.rb 2010-04-26 01:56:46.000000000 +0900
@@ -28,6 +28,24 @@
end
end
+unless defined?(subtitle)
+ def subtitle( date, index, escape = true )
+ sn = 1
+ diary = @diaries[date.strftime( '%Y%m%d' )]
+ diary && diary.each_section do |section|
+ if sn == index then
+ old_apply_plugin = @options['apply_plugin']
+ @options['apply_plugin'] = true
+ title = apply_plugin( section.subtitle_to_html, true )
+ @options['apply_plugin'] = old_apply_plugin
+ title.gsub!( /"/, '\"' ) if escape
+ return title
+ end
+ sn += 1
+ end
+ end
+end
+
# load tospy script and initialize
add_header_proc do
r = ''
@@ -44,6 +62,7 @@
<<-"EOS"
<div class="topsy_widget_data" style="float: right; margin-left: 1em;"> <!-- {
"url": "#{permalink(date, index)}",
+ "title": "#{subtitle(date, index)}",
"style": "big"
} --></div>
EOS
@@ -56,7 +75,7 @@
<img src="http://www.machu.jp/diary/twitter_logo_small.png" height="16" width="62" alt="Twitter">:
<div class="topsy_widget_data" style="float: right; margin-left: 1em;"> <!-- {
"url": "#{permalink(date, index)}",
- "title": "#{@subtitle || ''}",
+ "title": "#{subtitle(date, index)}",
"style": "small"
} --></div>
</div>
contribにコミットしました。
[ツッコミを入れる]

ELECOM USB2.0対応切替器 U2SW-T2

