4: 2006-03-25 (土) 22:45:03 [4] | 現: 2024-01-08 (月) 12:58:49 ゲスト [5] | ||
---|---|---|---|
Line 5: | Line 5: | ||
*スクリプト | *スクリプト | ||
#!/usr/local/bin/ruby | #!/usr/local/bin/ruby | ||
+ | |||
require 'net/http' | require 'net/http' | ||
require 'cgi' | require 'cgi' | ||
+ | |||
cgi = CGI.new | cgi = CGI.new | ||
par = [] | par = [] | ||
todaystr = Time.now.strftime("%Y%m%d") | todaystr = Time.now.strftime("%Y%m%d") | ||
a = true | a = true | ||
+ | |||
Dir.glob("\.\/????????.txt").each do |f| | Dir.glob("\.\/????????.txt").each do |f| | ||
if "./#{todaystr}.txt" == f then | if "./#{todaystr}.txt" == f then | ||
Line 21: | Line 21: | ||
end | end | ||
end | end | ||
+ | |||
sv = 'www2.hideyosi.com' | sv = 'www2.hideyosi.com' | ||
tp = '/~hideyosi_m/osask_ml/' | tp = '/~hideyosi_m/osask_ml/' | ||
# sv = 'www.afis.to' | # sv = 'www.afis.to' | ||
# tp = '/~mone/osask/osask_ml/' | # tp = '/~mone/osask/osask_ml/' | ||
+ | |||
if a then | if a then | ||
+ | |||
Net::HTTP.start( sv , 80 ) {|http| | Net::HTTP.start( sv , 80 ) {|http| | ||
response , = http.get(tp) | response , = http.get(tp) | ||
Line 37: | Line 37: | ||
} | } | ||
} | } | ||
+ | |||
open("./#{todaystr}.txt", "w") do |f| | open("./#{todaystr}.txt", "w") do |f| | ||
par.each { |pname| | par.each { |pname| | ||
Line 54: | Line 54: | ||
end | end | ||
end | end | ||
+ | |||
returl = "" | returl = "" | ||
inn = cgi['n'].to_s | inn = cgi['n'].to_s | ||
+ | |||
if inn then | if inn then | ||
open("./#{todaystr}.txt") do |f| | open("./#{todaystr}.txt") do |f| | ||
Line 67: | Line 67: | ||
end | end | ||
end | end | ||
+ | |||
if returl != "" then | if returl != "" then | ||
print cgi.header({"Location" => "http://#{sv}#{tp}#{returl}" }) | print cgi.header({"Location" => "http://#{sv}#{tp}#{returl}" }) | ||
Line 79: | Line 79: | ||
WikiからML発言ナンバーでリンクしたくて・・・それだけです。・・・最近Rubyネタばっかりだな 笑 | WikiからML発言ナンバーでリンクしたくて・・・それだけです。・・・最近Rubyネタばっかりだな 笑 | ||
+ | -こんなおもしろそうなのがあったとは!見落としていたニョ! ・・・これ、つかっちゃっていいんだよねぇ? だれが作ったページだろ? nisiさん? -- ''hideyosi'' &new{2006-03-25 (土) 22:46:00}; | ||
#comment | #comment |
(This host) = http://osask.net