å©è¨ãé ãã
ååï¼id:seiunsky:20070816:1187303569
ååã®ã³ã¡ã³ã㧠id:hatecha æ°ãã
ârequire ârssâã«ãããåããããã§ã
http://www.cozmixng.org/~rwiki/?cmd=view;name=RSS+Parser%3A%3ATutorial.ja
ã¨æãã¦ããã ããã
require 'rss'ãã¨ããã¨ãã³ã¡ã³ãæ¬ã«æ¸ãã¦ããã»ãã®ãã¼ãµãèªã¾ããããã«ãªãã®ããªã
ã¨ããããã§
å ¨æã®å ¥ã£ã¦ãã content:encoded ã¿ã°ãåå¾ãããã¨ãã§ããããã«ãªã£ãã
require 'rss' hatena_diary = 'http://d.hatena.ne.jp/seiunsky/rss' rss = open(hatena_diary) { |file| RSS::Parser.parse(file.read) } rss.output_encoding = "Shift-JIS" rss.items.each do |field| puts "[title]" + field.title puts "[link]" + field.link puts "[description]" + field.description puts "[content:encoded]" + field.content_encoded end
ã¤ãã§ã«ä½è¨ãª require ãåã£ãã
rssãªã¼ãã¼ ã§èªãã¨ãã¯ãã®ã¾ã¾ content:encoded ãåºåãã¦ãã®ãªã