Create a wrapper API on Tool Labs to interact with the Google Vision API to perform OCR on images from WikiSource. It will need to use Bryan's Google API proxy since Google's APIs require IP address whitelisting (and Tool Labs sends requests from random nodes with different IP addresses).
Acceptance criteria:
- The wrapper API should take the following input: language code, image URL.
- It should accept requests only from wikisource.org.
- Initially it should be limited to handling images that are no larger than 10 MB.
- It should encode the image (base64 byte stream?), add the API credentials, set the language in the languageHints array, and submit the request as JSON to the API proxy.
- The image should not be stored permanently anywhere on Tool Labs. (You can probably just read it into memory via curl.)
- It should return the OCRed text or an error message if there was an error.
See Google Vision API documentation at https://cloud.google.com/vision/docs/ and Discovery URL at https://vision.googleapis.com/$discovery/rest?version=v1. See T140037#2507218 and T140037#2528369 for the format of the JSON data to submit. Ask @kaldari for the API key.