-
Notifications
You must be signed in to change notification settings - Fork 35
Add API examples for various social media sites #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Example script for YouTube API. Includes some error correction and time based requests. Returns basic channel stats. Amount of serial prints configurable with debugger booleans.
Example script for Twitter API. Includes some error correction and time based requests. Returns basic stats. Amount of serial prints configurable with debugger booleans.
Example script for Github API. Includes some error correction and time based requests. Returns basic stats. Amount of serial prints configurable with debugger booleans.
Example script for Adafruit Discord Active Online Members. Includes some error correction and time based requests. Returns basic json data. Amount of serial prints configurable with debugger booleans.
Example script for Discord API. Includes some error correction and time based requests. Returns basic stats. Amount of serial prints configurable with debugger booleans.
reordered json before wifi import
pre-commit with black formatting
sleep_time_conversion = "days" | ||
|
||
# https://img.shields.io/discord/327254708534116352.svg | ||
ADA_DISCORD_SVG = "https://img.shields.io/discord/327254708534116352.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find! I didn't know there was JSON data available directly. Since it's not using an svg anymore lets change the variable name to ADA_DISCORD_JSON
or something that matches the new type instead.
print("Full API GET URL: ", ADA_DISCORD_SVG) | ||
print("===============================") | ||
try: | ||
ada_SVG_response = requests.get(ADA_DISCORD_SVG).json() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one can get rid of svg in the name of the variable as well. it could switch to json, or use 'discord' so that it's not tied to a specific type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes I originally started naming everything SVG and about halfway through found the JSON file. Forgot to rename everything. Will do. BTW I never did figure out how to work with the SVG directly. Typed in .json at the end of the filename in a fit of hair pulling desperation... and like a miracle it actually worked. Felt like I'd found a hidden cheat code. :P
Updated as recommended by FoamyGuy during his livestream. No more regex needed, using string replace.
I have to run black first before every commit? Ugh black you vex me. |
It does it automatically if you have |
hmm thought i'd installed pre-commit, maybe that was on my WSL ubuntu instance. installed again hopefully won't have this issue next time? |
It's public info so doesn't need to be in secrets.py
Nice, looks like it passed this time without having to run black manually. Think I've fixed everything requested? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great new examples, thanks @DJDevon3!
These look good to me. I tested discord, gh, and yt successfully on Feather S2 TFT. I looked over the twitter one, and it looks good to me, but did not run it.
Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.6.1 from 2.6.0: > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#103 from adafruit/optimizations > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#102 from tekktrik/dev/fix-pylint-errors > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 1.12.10 from 1.12.9: > Merge pull request adafruit/Adafruit_CircuitPython_Requests#115 from DJDevon3/main > Merge pull request adafruit/Adafruit_CircuitPython_Requests#119 from tekktrik/main > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions
Includes Youtube, Twitter, Github, and Discord examples.