2006-07-05 [長年日記]
_ URI関連のフィードを用意しました
ひとまずURIおよびメモに関するフィードをRSS 1.0形式(従来のMM/Memoと同じような形式)で用意しました。
- 新着メモ - http://1470.net/list/memo/recent/feed
- 新着メモに関連するURI - http://1470.net/list/memo/recent/feed/uri
- ユーザー新着メモ - http://1470.net/user/[userName]/feed
- ユーザー新着メモに関連するURI - http://1470.net/user/[userName]/feed/uri
- ユーザー日付別メモ - http://1470.net/user/[userName]/[year]/[month]/[day]/feed
- ユーザー日付別メモに関連するURI - http://1470.net/user/[userName]/[year]/[month]/[day]/feed/uri
URI以外のデータをどう扱うかはいまだに検討中です。一応Atom方向を考えてはいるんですが、調べなければならないことが盛りだくさんなので、ひとまずは慣れているRSS 1.0でお茶を濁しておきます。
_ やっつけ1470footer
RSSを配信したついでにmm_footerをやっつけで改造したけど、CSS周りとかいろいろ調整が必要なんで、自分で改造して使う根性がある人だけどうぞ。
add_body_leave_proc(Proc.new do |date|
oldest_date = Time.local(2005, 1, 11)
if date > oldest_date
if @mode == 'day' or @mode == 'latest'
userName = 'ishinao' # your 1470.net id
url = "http://1470.net/user/#{userName}/#{date.strftime('%Y/%m/%d')}"
rssurl = "http://1470.net/user/#{userName}/#{date.strftime('%Y/%m/%d')}/feed"
template_head = %Q[<div class="section mm_footer">\n<h3><a href="#{CGI.escapeHTML(url)}">今日のメモ</a> powered by <a href="http://1470.net/">1470.net</a></h3>\n<ul class="mm_footer">\n]
template_list = '<li>#{content.gsub(/href="\//, "href=\"http://1470.net\/")}</li>'
template_foot = "</ul>\n</div>\n"
cache_time = 3600;
if date.strftime('%Y-%m-%d') != Time.now.strftime('%Y-%m-%d')
cache_time = 3600 * 12;
end
rss_recent(rssurl, 50, cache_time, template_head, template_list, template_foot)
else
''
end
end
end)
[ツッコミを入れる]
[TrackBack URL: http://tdiary.ishinao.net/tb.rb/20060705]


