4: 2006-03-25 (土) 22:45:03 |
現: 2024-01-08 (月) 12:58:49 ゲスト |
| *スクリプト | | *スクリプト |
| #!/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 |
| 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) |
| } | | } |
| } | | } |
| + | |
| open("./#{todaystr}.txt", "w") do |f| | | open("./#{todaystr}.txt", "w") do |f| |
| par.each { |pname| | | par.each { |pname| |
| 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| |
| 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}" }) |
| | | |
| WikiからML発言ナンバーでリンクしたくて・・・それだけです。・・・最近Rubyネタばっかりだな 笑 | | WikiからML発言ナンバーでリンクしたくて・・・それだけです。・・・最近Rubyネタばっかりだな 笑 |
| + | -こんなおもしろそうなのがあったとは!見落としていたニョ! ・・・これ、つかっちゃっていいんだよねぇ? だれが作ったページだろ? nisiさん? -- ''hideyosi'' &new{2006-03-25 (土) 22:46:00}; |
| | | |
| #comment | | #comment |