adafruit / Adafruit_CircuitPython_Requests

Requests-like interface for web interfacing
MIT License
51 stars 36 forks source link

Update Twitch API Example with Connection Manager #170

Closed DJDevon3 closed 3 months ago

DJDevon3 commented 3 months ago

Requires Twitch developer account and oauth token. Instructions in code comments. Only pulls your own followers as a simple example.

Added

Attempted to ensure it meets Circuit Python current syntax styling including changing everything to f-strings, using settings.toml, basic doc strings for functions, sorted imports.

Serial output example:

Connecting to WiFi...
✅ Wifi!
 | Attempting Bearer Token Request!
 | 🔑 Token Authorized!
 | Token Expires in: 64.6 days
 | Attempting to GET Twitch JSON!
 | ✅ Twitch JSON!
 |  | Followers: 63
✂️ Disconnected from Twitch API

Finished!
Board Uptime: 5 hours
Next Update: 15 minutes
===============================