Skip to content

Instantly share code, notes, and snippets.

@mcurtis
Created December 1, 2011 23:38
Show Gist options
  • Save mcurtis/1420723 to your computer and use it in GitHub Desktop.
Save mcurtis/1420723 to your computer and use it in GitHub Desktop.
def fetch_ftp
ftp = Net::FTP.new(self.meta[:host])
ftp.login(user = self.username, passwd = self.password)
ftp.getbinaryfile(self.url, "dl-#{self.id}.txt")
ftp.quit()
output = MultiXml.parse(File.open("dl-#{self.id}.txt", "rb").read) rescue nil
File.delete("dl-#{self.id}.txt")
output
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment