Gem Version Build Status Code Climate Test Coverage

putio-ruby is a simple gem for communicating with the Put.io REST API. Currently supports just a handful of endpoints for Files and Transfers.

Installation

Add the gem to your Gemfile:

gem 'putio-ruby'

And then

$ bundle install

Or install it yourself as:

$ gem install putio-ruby

Usage

First configure the gem to use your oauth token (See instructions for generating a token)

Putio.configure do |config|
  config.oauth_token = "YOUR_OAUTH_TOKEN"
end

Then use it to query Put.io

Putio::File.list              # => [#<Putio::File:0x007fe1b3a84d40, ...]
file = Putio::File.get(1234)  # => #<Putio::File:0x007fe373b07558
file.download_url             # => "https://dlw3.put.io/download/12345..."
file.delete                   # => true

Putio::Transfer.list                        # => [#<Putio::Transfer:0x007fe373a80580, ...]
Putio::Transfer.get(1234)                   # => #<Putio::Transfer:0x007fe373a9afc0
Putio::Transfer.add("http://some_url.com")  # => #<Putio::Transfer:0x007fe373aa2c70