понедельник, 30 мая 2011 г.

RDropbox

RDropbox – Ruby библиотка для работы с сервисом Dropbox.



# STEP 1: Authorize the user
session = Dropbox::Session.new('your_consumer_key', 'your_consumer_secret')
puts 'Visit #{session.authorize_url} to log in to Dropbox. Hit enter when you have done this.'
gets
session.authorize
session.sandbox = true

# STEP 2: Play!
session.upload('testfile.txt')
uploaded_file = session.file('testfile.txt')
puts uploaded_file.metadata.size

uploaded_file.move 'new_name.txt'
uploaded_file.delete

Комментариев нет:

Отправить комментарий