多くのソーシャルブックマークサービスにあなたのサイトを対応させたくありませんか?たくさんのブックマーク追加ボタンをまとめたくありませんか? Add Clipsはいっぱいあるソーシャルブックサイトのブックマーク追加ボタンを1つに統合して、どのソーシャルブックマークを使っているユーザーにも対応できるブックマークボタンを提供するサービスです。
メモメモ。
addclips.rb
というか tDiary のプラグインを作って
設置してみた。
# addcilps.rb unless @conf.mobile_agent? || /^append|replace|comment|showcomment|trackbackreceive|pingbackreceive$/ =~ @mode then def addclips_title_text( subtitle, title ) old_apply_plugin = @conf['apply_plugin'] @conf['apply_plugin'] = true r = apply_plugin( subtitle.sub( @conf.section_anchor, '' ), true ) @conf['apply_plugin'] = old_apply_plugin "#{r.strip} - #{title}".gsub(/'/){"\\'"} end def addclips_permalink( date, index = nil, escape = true) ymd = date.strftime( "%Y%m%d" ) uri = @conf.index.dup uri[0, 0] = @conf.base_url unless %r|^https?://|i =~ uri uri.gsub!( %r|/\./|, '/' ) if index != nil a = anchor( "#{ymd}p%02d" % index ) else a = anchor( "#{ymd}" ) end if escape uri + CGI::escape( a ) else uri + a end end add_subtitle_proc do |date, index, subtitle| t = addclips_title_text( subtitle, "#{@conf.html_title} (#{date.strftime('%Y-%m-%d')})" ) p = addclips_permalink( date, index, false ) r = subtitle.dup r << %Q[<!-- AddClips Code START -->\n] r << %Q[<script type="text/javascript">\n] r << %Q[AddClipsUrl = '#{p}';\n] r << %Q[AddClipsTitle = '#{t}';\n] r << %Q[AddClipsId = 'your_id_please';\n] r << %Q[AddClipsBcolor='#78BE44';\n] r << %Q[AddClipsNcolor='#D1E9C0';\n] r << %Q[AddClipsTcolor='#666666';\n] r << %Q[AddClipsType='4';\n] r << %Q[AddClipsVerticalAlign='middle';\n] r << %Q[</script><script type="text/javascript" src="http://js.addclips.org/v2/addclips.js" charset="utf-8"></script>\n] r << %Q[<!-- AddClips Code END -->\n] end end
your_id_please のところを適当に書き換えて使ってくださいね。