adafruit / Adafruit_CircuitPython_Requests

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

Update Discord Shields.io Example with Connection Manager #162

Closed DJDevon3 closed 3 months ago

DJDevon3 commented 3 months ago

General code cleanup from last version. Adafruit uses Shields.io for getting Discord active online users and displaying them in SVG badges in the blog and social media. Publicly free API authorized and endorsed by Adafruit. There's only a few endpoints in the entire JSON so a debug dump doesn't require a warning. Updated with Connection Manager and pretty serial hierarchy view.

Serial Output Example:

✅ Wifi!
 | Attempting to GET Adafruit Discord JSON!
 | ✅ Adafruit Discord JSON!
 |  | Full API GET URL:  https://img.shields.io/discord/327254708534116352.json
 |  | JSON Dump:  {'color': 'brightgreen', 'label': 'chat', 'message': '4475 online', 'name': 'chat', 'value': '4475 online', 'link': []}
 |  | Active Online Users: 4475

Finished!
Board Uptime: 124960.0
Next Update: 15 minutes
===============================