הסקריפט בו אני משתמש להוריד את
תמונת המכ"ם: #!/usr/bin/ruby require ´net/http´ class Radar Host=´nasa.proj.ac.il´ Port=80 URI=´/radar/PRADAR.gif´ RadarDir=´/home/idan/maps/radar´ attr_accessor :data def initialize() t=Time.now @fn=t.strftime ´%d%m%Y/%H%M.gif´ @dir=t.strftime ´%d%m%Y´ end def read() data=nil Net::HTTP.start(Host,Port) do |http| response,data=http.get URI end @data=data end def store(topng=true) Dir.chdir RadarDir File.exists?(@dir) || Dir.mkdir(@dir) File.open(@fn,"w") do |f| f << @data end system("/usr/bin/gif2png -O -d #{@fn}") if topng end end if __FILE__==$0 r=Radar.new r.read r.store end
תמונת המכ"ם: #!/usr/bin/ruby require ´net/http´ class Radar Host=´nasa.proj.ac.il´ Port=80 URI=´/radar/PRADAR.gif´ RadarDir=´/home/idan/maps/radar´ attr_accessor :data def initialize() t=Time.now @fn=t.strftime ´%d%m%Y/%H%M.gif´ @dir=t.strftime ´%d%m%Y´ end def read() data=nil Net::HTTP.start(Host,Port) do |http| response,data=http.get URI end @data=data end def store(topng=true) Dir.chdir RadarDir File.exists?(@dir) || Dir.mkdir(@dir) File.open(@fn,"w") do |f| f << @data end system("/usr/bin/gif2png -O -d #{@fn}") if topng end end if __FILE__==$0 r=Radar.new r.read r.store end