An open API service indexing awesome lists of open source software.

https://github.com/mikz/space_monkey

Ruby Client for Space Monkey API
https://github.com/mikz/space_monkey

Last synced: 12 days ago
JSON representation

Ruby Client for Space Monkey API

Awesome Lists containing this project

README

        

# SpaceMonkey [![Build Status](https://travis-ci.org/mikz/space_monkey.svg)](https://travis-ci.org/mikz/space_monkey) [![Coverage Status](https://img.shields.io/coveralls/mikz/space_monkey.svg)](https://coveralls.io/r/mikz/space_monkey)

Ruby Client for Space Monkey API.

Experimental. Space Monkey API is not public yet and it can change any time.

## What is Space Monkey?

Space Monkey (https://www.spacemonkey.com/) is a 1TB Hard Drive with cloud backup.
When your device is offline, you can access to the files distributed in cloud network.
Their [Kickstarter page](https://www.kickstarter.com/projects/clintgc/space-monkey-taking-the-cloud-out-of-the-datacente) has great video explaining what they do.

## Installation

Add this line to your application's Gemfile:

gem 'space_monkey'

And then execute:

$ bundle

Or install it yourself as:

$ gem install space_monkey

## Usage

### Downloading a file

```ruby
client = SpaceMonkey::Client.new
client.login('[email protected]', 'password')

photos = client.inode.path('Photos')

first_photo = client.photos.entries.first

File.open(first_photo.name, 'wb') do |file|
file.write client.file.download(first_photo, network_reads: true)
end
```

### Uploading a file

```ruby
client = SpaceMonkey::Client.new
client.account.login('[email protected]', 'password')

photos = client.inode.home

file = client.file.new(name: 'somefile.jpg')
io = File.open('to_upload.jpg')

uploaded = client.file.upload(file, inode, io)
```

## What is supported

- [x] Downloads
- [x] Uploads
- [x] Thumbnails
- [x] Sharing
- [ ] Moving
- [ ] Deleting
- [ ] Bulk Actions

## TODO

1. figure out how to stream files
httpclient allows it, but faraday does not
2. create fake server for testing

## Contributing

1. Fork it ( https://github.com/mikz/space_monkey/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request