Skip to content

Commit

Permalink
Add herotwitter module.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodolfosantos committed Jun 24, 2015
1 parent eb966fc commit 38912b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
12 changes: 3 additions & 9 deletions gopro.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import time

goproHTTPRoot = "http://10.5.5.9/videos/DCIM/"
goproHTTPShutter = "http://10.5.5.9/gp/gpControl/command/shutter?p=1"

def takeshot():
r = requests.get("http://10.5.5.9/gp/gpControl/command/shutter?p=1")
r = requests.get(goproHTTPShutter)
return r.status_code

def getFoldersList():
Expand Down Expand Up @@ -48,7 +49,6 @@ def getAllPhotoPaths():

def getLastPhotoPath():
allPhotosPathsList = sorted(getAllPhotoPaths())
print allPhotosPathsList
return allPhotosPathsList[-1]

def downloadPhoto(url):
Expand All @@ -59,10 +59,4 @@ def takePhotoAndDownload():
status = takeshot()
time.sleep(5)
lastPhoto = getLastPhotoPath()
return downloadPhoto(goproHTTPRoot + lastPhoto)



if __name__ == '__main__':
takenPhotoName = takePhotoAndDownload()
print takenPhotoName
return downloadPhoto(goproHTTPRoot + lastPhoto)
6 changes: 6 additions & 0 deletions herotwitter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import gopro
import twitter

def takePhotoAndUpload(status):
takenPhotoName = gopro.takePhotoAndDownload()
return twitter.tweet(status, takenPhotoName)
8 changes: 0 additions & 8 deletions main.py

This file was deleted.

0 comments on commit 38912b9

Please sign in to comment.