RDF

きまぐれ日記

検索エンジンから来たにゃらば、左のフォームで再検索すべし。


2004-05-24 [長年日記]

_ [tDiary][xml][net] output_rdf.rb修正。

nakanotさんとこからFEED Validatorつうのを知ったので、自分のRSSをチェックしたら、W3CDTFじゃねー、と思いっきりinvalidだった。(わら

てことで、output_rdf.rbを再度修正。validになるようにした。("+09:00"なんて決め打ちなんで、チョー恥ずかしい修正だけど)

_ えろぺおさんのご助言をもとに修正。決め打ち文字がなくなって恥ずかしさが減りました。(笑) Ruby知らずに、最低限必要なところだけ読んでやってるので相変わらずやっつけ仕事だけど、結果オーライってことで。(仕事はどうした? とは言わない約束だよ…)

&gy; diff -u output_rdf.rb.orig output_rdf.rb
--- output_rdf.rb.orig  Thu Mar  4 20:18:55 2004
+++ output_rdf.rb       Mon May 24 14:25:25 2004
@@ -17,6 +17,9 @@
 end
 
 def output_rdf_update
+       # added by yoshi on 2004/05/24 to use xmlschema method.
+       require "time"
+
        date = @date.strftime("%Y%m%d")
        diary = @diaries[date]
        uri = "#{@conf.base_url}#{@conf.index}".gsub(%r|/\./|, '/')
@@ -36,7 +39,7 @@
    <link>#{uri}</link>
    <description>#{CGI::escapeHTML( @html_title )}</description>
    <dc:creator>#{CGI::escapeHTML( @conf.author_name )}</dc:creator>
-   <dc:date>#{Time.now.strftime('%Y-%m-%dT%H:%M')}</dc:date>
+   <dc:date>#{Time.now.xmlschema}</dc:date>
        RDF
 
        rdf_image = @options['output_rdf.image']
@@ -80,6 +83,8 @@
        end
 
        idx = 1
+       # added by yoshi for creation of dc:date tag
+       tmp_t = Time.local( diary.date.year, diary.date.mon, diary.date.day );
        diary.visible? and diary.each_section do |section|
                if section.subtitle then
                link = %Q[#{uri}#{anchor "#{date}\#p#{'%02d' % idx}"}]
@@ -97,6 +102,7 @@
    <link>#{link}</link>
    <dc:creator>#{CGI::escapeHTML( @conf.author_name )}</dc:creator>
    <description>#{CGI::escapeHTML( desc )}</description>
+   <dc:date>#{(tmp_t+idx).xmlschema}</dc:date>
  </item>
                RDF
                end
@@ -110,7 +116,7 @@
    <title>#{comment_today}-#{idx} (#{CGI::escapeHTML( comment.name )})</title>
    <link>#{link}</link>
    <description>#{CGI::escapeHTML( @conf.shorten( comment.body ) )}</description>
-   <dc:date>#{comment.date.strftime('%Y-%m-%dT%H:%M')}</dc:date>
+   <dc:date>#{comment.date.xmlschema}</dc:date>
    <dc:creator>#{CGI::escapeHTML( comment.name )}</dc:creator>
  </item>
                        RDF

2003|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|09|10|11|12|
2024|01|02|03|04|
総アクセス / 今日 / 昨日 このページのテーマ: