Skip to content

Instantly share code, notes, and snippets.

@jubalh
Created July 13, 2018 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jubalh/2d209b7879a7508c35db3f7a6464be01 to your computer and use it in GitHub Desktop.
Save jubalh/2d209b7879a7508c35db3f7a6464be01 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from picamera import PiCamera
from time import sleep
import time
import sys
from subprocess import call
path = '/home/pi/hedwig-pictures/'
datetime = time.strftime("%Y%m%d-%H%M%S")
filename = path + datetime + '.jpg'
cam = PiCamera()
cam.start_preview()
cam.capture(filename)
cam.stop_preview()
call(["scp", filename, "hedwig-account@hogwarts.dumbledo.re:/srv/www/hedwig-content"])
print 'http://hedwig.hogwarts.dumbledo.re/' + datetime + '.jpg'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment