My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/local/bin/ruby

# command line test
# $ ruby ab2xml.cgi destname1=ローマ
#

require "lib/abroad-air-rss.rb"
require "cgi"
require "rubygems"
require "kconv"

cgi = CGI.new

@obj = AbroadAirRss.new()
enc = nil
case cgi.params['enc'].to_s
when 'utf8'
enc = Kconv::UTF8
when 'euc'
enc = Kconv::EUC
when 'sjis'
enc = Kconv::SJIS
end
@obj.queries.each do |key,value|
param = nil
if cgi.params.has_key?(key)
param = cgi.params[key][0].to_s
if enc
param = param.kconv(Kconv::UTF8,enc)
else
param = param.toutf8
end
end
@obj.queries[key]=param || ""
end
print cgi.header("text/xml")
print @obj.rss




Change log

r2 by takao.funami on May 5, 2009   Diff
ab-road
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 651 bytes, 41 lines

File properties

svn:executable
*
Powered by Google Project Hosting