K
Knute Johnson
Would somebody please try this on Linux for me. It works fine on
Windows but hangs on Fedora.
Thanks,
#!/usr/bin/ruby
require 'net/ftp'
def getMetar(id)
metar = Array.new
i = 0
ftp = Net::FTP.new('tgftp.nws.noaa.gov')
puts ftp.login
puts ftp.sendcmd('PASV')
ftp.chdir('/data/observations/metar/stations')
ftp.gettextfile("#{id.upcase}.TXT") do |line|
metar = line
i = i + 1
end
ftp.close
return metar
end
puts getMetar("KBFL")
Windows but hangs on Fedora.
Thanks,
#!/usr/bin/ruby
require 'net/ftp'
def getMetar(id)
metar = Array.new
i = 0
ftp = Net::FTP.new('tgftp.nws.noaa.gov')
puts ftp.login
puts ftp.sendcmd('PASV')
ftp.chdir('/data/observations/metar/stations')
ftp.gettextfile("#{id.upcase}.TXT") do |line|
metar = line
i = i + 1
end
ftp.close
return metar
end
puts getMetar("KBFL")