Skip to content

Instantly share code, notes, and snippets.

View radiocolin's full-sized avatar

Colin Weir radiocolin

View GitHub Profile
@radiocolin
radiocolin / MagicToken.py
Last active August 2, 2022 14:50
Auto-rotating OAuth Token in Python
#Blog post describing this pattern here: https://colinsent.me/The-Magical-Self-Rotating-Self-Getting-OAuth-Token-aa8e8a840e9643fd9f4ca8f9e97e53e9
import requests
import datetime
class MagicToken:
config = {
"client_id": "123456",
"client_secret": "shh",
"scope": [ "read", "write", "etc" ],

Keybase proof

I hereby claim:

  • I am radiocolin on github.
  • I am colinweir (https://keybase.io/colinweir) on keybase.
  • I have a public key whose fingerprint is B884 224B CDC0 957B 8EF0 48FB D71E 4D21 2D1E C3D4

To claim this, I am signing this object: