刚刚在音乐空间里发了几首歌 敲了几句ruby代码 刷刷人气 呵呵
为什么博客园的代码没有Ruby格式的 看来我只能用python格式的了
写这种小东西 python和ruby perl 都很快很好用 呵呵
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
h = 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
}
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
h = 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 都很快很好用 呵呵