Accepts arguments to be used with multiple cron scripts
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import requests
|
||||
import datetime
|
||||
import sys
|
||||
|
||||
url = 'http://192.168.86.207:5000/snapshot/plants.jpg'
|
||||
url = sys.argv[1]
|
||||
|
||||
data = requests.get(url).content
|
||||
path = sys.argv[2]
|
||||
fn = datetime.datetime.now().strftime("%Y%m%d%H%M")
|
||||
|
||||
with open(fn + '.jpg', 'wb') as f:
|
||||
with open(path + fn + '.jpg', 'wb') as f:
|
||||
f.write(data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user