openlabs/Microsoft-Translator-Python-API — pull request #4 by ttempe (2013-04-29 09:22:03+00:00)
Title: Request a new auth token after 10 minutes

Microsoft Authentication tokens expire after 10 minutes.
Before, a translation request sent over 10 minutes later than the authentication would just fail.
This patch records the creation time of the auth token, and checks it before each translation request.

I also added an unit test that will issue a request, then wait for 10 minutes before issuing another one.