李超

cc编程笔记本。

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
刚刚在音乐空间里发了几首歌  敲了几句ruby代码  刷刷人气 呵呵
require 'net/http'

count 
= 1..100000  # define an array

count.each{      
# each 
|index|             # element is index  1 2 3 4 5 6
printf "#{index} " #print index and space
= Net::HTTP.new('space.cnblogs.com',80# create a object
resp, data = h.get('/group/topic/1605/',nil) # get 
if resp.code != "200" # if http response status code not is 200 
  puts resp.code    #put status code
  puts resp.message #put status message
  
  resp.each{    
#put headers
  |key, val|
  puts 
"#{key}\t\t\t#{val}"
  }
  
  p data    
#put html
  break # break the eache
end
#sleep(1) #sleep  use second do inteval
}

为什么博客园的代码没有Ruby格式的 看来我只能用python格式的了

写这种小东西 python和ruby perl 都很快很好用 呵呵
posted on 2008-03-25 17:30  coderlee  阅读(477)  评论(1编辑  收藏  举报