require 'rss'
require 'open-uri'
require 'jcode'
$KCODE = "u"
URL = "http://tiantian911.iteye.com/rss"
open(URL) do |h|
resp = h.read
result = RSS::Parser.parse(resp,false)
puts "Channel: #{result.channel.link}"
result.items.each_with_index do |item,i|
i += 1
puts "#{i} #{item.link}"
j=0
loop do
Net::HTTP.get_print URI.parse(item.link)
j+=1
break if j>=10
end
end
end
一段隐秘的代码
最新推荐文章于 2024-08-24 23:02:54 发布