Created
April 22, 2015 07:04
-
-
Save tamoot/a881414208b42d73c46a to your computer and use it in GitHub Desktop.
tDiary用食べログ店舗情報埋め込みプラグイン
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'uri' | |
def tabelog_badge(url, name) | |
id = File::basename(URI::parse(url).path) | |
script_url = %Q|http://tabelog.com/badge/google_badge?escape=false&rcd=#{id}| | |
return %Q|<div><strong><a href="#{url}" target="_blank">#{h(name)}</a></strong><br><script src="#{script_url}" type="text/javascript" charset="utf-8"></script></div>| | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! tabelog | |
{{tabelog_badge "http://tabelog.com/toyama/A1601/A160101/16000285/", "麺屋つくし - 富山市"}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment