Dealing with the image
As discussed before, when Arduino sends a message to Python, it is going to take a snapshot using the camera and save it to the computer. What do we do with it, then? How do we upload it to a file sharing platform? There are several ways to do this, but in this chapter, we will be using Imgur. Yes, the same Imgur that you have been using, knowingly or unknowingly, on Reddit or 9gag.
Go to http://imgur.com/ and sign up for a new account.
Once you have verified your account, go to https://api.imgur.com/oauth2/addclient to add a new application so that Imgur permits you to post images using a script. Use the following information:
Application name: Arduino burglar alarm
Authorization type: OAuth 2 authorization without callback URL
Email: <your email>
Description: Using Arduino to catch the cookie thieves
Now proceed, and you will get a page like this:
Imgur will give you the Client ID and Client secret. Save them in a safe location as we will need them later.
Let us...