Recently I made a post about Web Services in Ruby. It is of course also possible to get data in the traditional, old-fashioned way through FTP, and it is just as simple to upload/download files to/from an FTP server as using a Web Service. Just use the standard Net::FTP class (see also recipe 14.8 of the Ruby Cookbook)

require 'net/ftp'
ftp=Net::FTP.new
ftp.connect(URL,21)
ftp.login(username,passwd)
ftp.chdir(directory)
ftp.getbinaryfile(filename)
ftp.close
Advertisements