Created
August 3, 2013 10:03
-
-
Save codebrane/6145940 to your computer and use it in GitHub Desktop.
Taking a picture with the Raspberry Pi camera and uploading it to Dropbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'dropbox_sdk' | |
file = File.open('access_token', "rb") | |
access_token = file.read | |
client = DropboxClient.new(access_token) | |
puts "taking picture..." | |
system('raspistill -o camera_image.jpg') | |
puts "uploading..." | |
file = open('camera_image.jpg') | |
response = client.put_file('/latest.jpg', file) | |
puts "uploaded:", response.inspect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment