@@ -0,0 +1,1190 @@
+#/bin/env python%0A# -*-coding:utf=8 -*-%0Aimport os,time,subprocess,shlex%0Aimport urllib2%0Adef upload_yeelink(image_name, log_file):%0A    url = 'http://api.yeelink.net/v1.0/device/719/sensor/8613/photos'%0A    length = os.path.getsize(image_name)%0A    image_data = open(image_name, 'rb')%0A    request = urllib2.Request(url, data=image_data)%0A    request.add_header('U-ApiKey', '14765d9cc6aec5057880398486d08f9c')%0A    request.add_header('Content-Length', '%25d' %25 length)%0A    res = urllib2.urlopen(request).read().strip()%0A    log_file.write(res + '%5Cn')%0A%0Aif __name__ == '__main__':%0A    images_path = os.path.join(os.getcwd(), 'image')%0A    log = open(os.path.join(os.getcwd(), 'output.log'),'w+')%0A    if not os.path.exists(images_path):%0A        os.makedirs(images_path)%0A    com_line = 'fswebcam -d /dev/video0 -r 320x240 --bottom-banner --title %22%25s%22 --no-timestamp %25s/%25s.jpg'%0A    while True:%0A        time_now = time.strftime('%25Y-%25m-%25d-%25H-%25M-%25S')%0A        com_line_now = com_line %25 (time_now, images_path, time_now)%0A        subprocess.call(shlex.split(com_line_now), stdout=log, stderr=log)%0A        upload_yeelink('%25s/%25s.jpg' %25 (images_path, time_now), log)%0A        print com_line_now%0A        time.sleep(11)%0A

add main.py