サイトトップへ
OSASK.NET
  サイトトップへ       新掲示板(閉鎖済)   Wiki(凍結済)   旧掲示板(廃止済)   ニュース(廃止済)  
1: 2003-12-04 (木) 23:09:00 ソース 現: 2024-01-08 (月) 12:58:49 ゲスト ソース
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' 
 + tp = '/~hideyosi_m/osask_ml/' 
 + # sv = 'www.afis.to' 
 + # tp = '/~mone/osask/osask_ml/' 
 + 
 if a then  if a then
- +  
-  Net::HTTP.start( 'www.afis.to', 80 ) {|http| +  Net::HTTP.start( sv , 80 ) {|http| 
-  response , = http.get('/~mone/osask/osask_ml/index.html')+  response , = http.get(tp)
  response.body.split("\n").each{|pul|   response.body.split("\n").each{|pul|
  if /HREF=\"(\d{6})\/\"\>/ =~ pul then   if /HREF=\"(\d{6})\/\"\>/ =~ pul then
Line 32: Line 37:
  }   }
  }   }
 + 
  open("./#{todaystr}.txt", "w") do |f|   open("./#{todaystr}.txt", "w") do |f|
  par.each { |pname|   par.each { |pname|
-  Net::HTTP.start( 'www.afis.to', 80 ) {|http| +  Net::HTTP.start( sv, 80 ) {|http| 
-  response , = http.get("/~mone/osask/osask_ml/#{pname}/index.html")+  response , = http.get("#{tp}#{pname}/index.html")
  response.body.split("\n").each{|pul|   response.body.split("\n").each{|pul|
  if /HREF=\"msg(\d{5})\.html\"\>\[(?:OSASK|osask) (\d+)\] (.+)\<\/A\>/ =~ pul then   if /HREF=\"msg(\d{5})\.html\"\>\[(?:OSASK|osask) (\d+)\] (.+)\<\/A\>/ =~ pul then
-  surl = "http://www.afis.to/~mone/osask/osask_ml/#{pname}/msg#{$1}.html"+  surl = "#{pname}/msg#{$1}.html"
  smid = "[OSASK #{$2}]"   smid = "[OSASK #{$2}]"
  smti = "#{$3}"   smti = "#{$3}"
Line 49: 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 62: Line 67:
  end   end
 end  end
 + 
 if returl != "" then  if returl != "" then
-  print cgi.header({"Location" => returl })+  print cgi.header({"Location" => "http://#{sv}#{tp}#{returl}" })
  print "転送 >> #{returl}"   print "転送 >> #{returl}"
 else  else
  cgi.out{"みつからない~ぐへぇ・・・"}   cgi.out{"みつからない~ぐへぇ・・・"}
 end  end
 +
*何に使うんだ? *何に使うんだ?
WikiからML発言ナンバーでリンクしたくて・・・それだけです。・・・最近Rubyネタばっかりだな 笑 WikiからML発言ナンバーでリンクしたくて・・・それだけです。・・・最近Rubyネタばっかりだな 笑
 +-こんなおもしろそうなのがあったとは!見落としていたニョ! ・・・これ、つかっちゃっていいんだよねぇ? だれが作ったページだろ? nisiさん? -- ''hideyosi'' &new{2006-03-25 (土) 22:46:00};
 +
 +#comment

トップ   差分 バックアップ 複製 名前変更 リロード印刷に適した表示   ページ新規作成 全ページ一覧 単語検索 最新ページの一覧   ヘルプ
新着

目次
メンバー一覧


最新の20件
2016-10-01 2016-09-08
  • @MenuBar.
2016-09-07 2016-09-04 2016-08-15 2015-09-23 2014-07-30 2014-07-04 2014-02-04 2013-10-26 2013-06-21 2013-06-17 2013-06-15 2013-04-02 2013-02-09 2013-02-04 2012-12-25 2012-12-01 2012-05-28 2012-03-31

トピック一覧
一般用コメント最新
新掲示板lina
2016/9/5 20:58
SandBoxゲスト
2016/9/4 12:01
RecentDeletedlina
2015/6/2 19:29
Old-OSASK-MLlina
2014/6/29 9:14
hideyosi/メールhideyosi
2014/1/6 20:17
hideyosi/募集中lina
2013/11/8 19:56

このサイトは川合秀実から委託を受けて、OSASKコミュニティによって管理・運営されています。