Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # lib to fetch all batch througth ftp and get cover files and mp3
- require 'net/ftp'
- class Batch
- def initialize(ftp)
- begin
- @ftp = ftp
- @ftp.login(FTPUSER, FTPPASS)
- rescue Exception => e
- raise e.message
- end
- end
- def list_all
- p @ftp.list('batch_*')
- end
- def close
- @ftp.close
- end
- end
- FTPSERVER = "pias.kantik.net"
- FTPUSER = "pias.kantik.net"
- FTPPASS = "piaskantik"
- BATCH_DIR = "/Kantik"
- batch = Batch.new(Net::FTP.new(FTPSERVER))
- batch.list_all
- batch.close
Add Comment
Please, Sign In to add comment