Skip to content

Instantly share code, notes, and snippets.

@kayakaya
Created August 31, 2009 16:45
Show Gist options
  • Save kayakaya/178558 to your computer and use it in GitHub Desktop.
Save kayakaya/178558 to your computer and use it in GitHub Desktop.
Index: ja/section_footer2.rb
===================================================================
--- ja/section_footer2.rb (リビジョン 35100)
+++ ja/section_footer2.rb (作業コピー)
@@ -1,2 +1,4 @@
+# -*- coding: utf-8 -*-
# section_footer2.rb: Japanese resource
@section_footer2_delicious_label = "このエントリの del.icio.us history"
+@section_footer2_twitter_label = "このエントリにつぶやく"
Index: section_footer2.rb
===================================================================
--- section_footer2.rb (リビジョン 35100)
+++ section_footer2.rb (作業コピー)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
# section_footer2.rb
#
# Copyright (c) 2008 SHIBATA Hiroshi <h-sbt@nifty.com>
@@ -29,6 +30,7 @@
alias subtitle_link_original subtitle_link
def subtitle_link( date, index, subtitle )
+ @subtitle = subtitle.gsub( /\[(.*?)\]/ , '')
s = ''
if subtitle then
s = subtitle.sub( /^(?:\[[^\[]+?\])+/ ) do
@@ -61,7 +63,10 @@
Dir.glob( yaml_dir + "*.yaml" ) do |file|
r << parse_sbm_yaml(file, date, index)
end
-
+
+ #add_twitter
+ r << add_twitter(date, index)
+
# add Permalink
r << %Q|<a href="#{permalink(date, index, false)}">Permalink</a> |
@@ -136,3 +141,25 @@
return r
end
+
+def add_twitter(date, index)
+ r = ""
+
+ unless @conf['twitter.user'].nil?
+
+x r << %Q|<a href="http://twitter.com/home?status=RT @#{@conf['twitter.user']}:#{@subtitle} #{permalink(date, index)}">|
+ r << %Q|<img src="#{@conf['twitter.icon']}" style="border: none;vertical-align: middle;" |
+ r << %Q|title="#{@section_footer2_twitter_label}" |
+ r << %Q|alt="#{@section_footer2_twitter_label}" />|
+ r << '</a>'
+ r << ' | '
+
+ end
+ return r
+end
+
+# Local Variables:
+# ruby-indent-level: 3
+# tab-width: 3
+# indent-tabs-mode: t
+# End:
Index: en/section_footer2.rb
===================================================================
--- en/section_footer2.rb (リビジョン 35100)
+++ en/section_footer2.rb (作業コピー)
@@ -1,2 +1,3 @@
# section_footer2.rb: English resource
@section_footer2_delicious_label = "del.icio.us history for this entry"
+@section_footer2_twitter_label = "tweet this entry"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment