Guest User

Untitled

a guest
Nov 20th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. app = Flask(__name__)
  2.  
  3. @app.route("/", methods=['GET', 'POST'])
  4. def camera_toggle():
  5. from_number = request.values.get('From', None)
  6. from_message = request.values.get('Body', None)
  7.  
  8. resp = MessagingResponse()
  9. resp.message("Please enter your username:password")
  10. if ":" not in from_message:
  11. #Split the username/password, then somehow login??
  12. return str(resp)
  13. else:
  14. from_number = request.values.get('From', None)
  15. from_message = request.values.get('Body', None)
  16. if callers[from_number] == "John Doe":
  17. if from_message == "CameraON":
  18. subprocess.call(["bash", "camera.sh"])
  19. return str("Please enter the keyword to turn on the camera")
Add Comment
Please, Sign In to add comment