Skip to content

Instantly share code, notes, and snippets.

@heftig
Forked from mcurtis/gist:1420723
Created December 1, 2011 23:40
Show Gist options
  • Save heftig/1420730 to your computer and use it in GitHub Desktop.
Save heftig/1420730 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)
buffer = ""
ftp.getbinaryfile(self.url) { |data| buffer << data }
ftp.quit()
MultiXml.parse(buffer) rescue nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment