Megar (“megaargh!” in pirate-speak) is a Ruby wrapper and command-line client for the Mega API.
In the current release (gem version 0.0.3), it has coverage of the basic file/folder operations: connect, get file/folder listings and details, upload and download files. You can use it directly in Ruby with what I hope you'll find is a very sane API, but it also sports a basic command-line mode for simple listing, upload and download tasks.
If you are interested in hacking around with Mega, and prefer to do it in Ruby, give it a go! Like this:
# do a complete folder/file listing session = Megar::Session.new(email: 'firstname.lastname@example.org', password: 'my_password') session.folders.each do |folder| folder.files.each do |file| puts file.name end end # upload a file file_handle = '../my_files/was_called_this.mp3' session.files.create( name: 'First.mp3', body: file_handle )Or from the command line:
$ megar -e email@example.com -p my_password ls $ megar -e firstname.lastname@example.org -p my_password put *.pdfI would still call it "experimental" at this stage because it needs more widespread hammering, and of course the Mega API is not fully documented yet. There are many more features of the API that it would be good to support, and I'd love for others to pitch in and help - go fork it on github!
I was keen to get a Mega account and check it out when the launch publicity hit, and was immediately impressed by the web interface. Very slick. Notwithstanding some of the intense analysis and some criticism (for example by SpiderOak and Security Now), the "trust no-one" design approach is very interesting to contemplate and hack around with.
It didn't take me long to realise there was nothing much going on with Ruby. After a bit of messing around, I think the main reason for that is the pretty wretched state of cryptographic support in Ruby. Unlike Python (which has PyCrypto amongst others I'm sure), in Ruby we still on the whole get by with thin wrappers on OpenSSL that look and smell distinctly C-dy. But that's a challenge for another day...
For now I'm pretty happy that Megar has all the main crypto challenges solved (after a bit of low-level reverse engineering supported by a healthy dose of TDD). Now I wonder what I'm going to use it for?