witnessmenow / arduino-youtube-api

A wrapper around the youtube api for arduino
MIT License
143 stars 48 forks source link

Examples Rework #37

Closed dmadison closed 3 years ago

dmadison commented 4 years ago

This PR combines both the ESP8266 and ESP32 examples into one, as they were near identical other than the WiFi include statements and the setInsecure() function call on the 8266 version. Both of these are now handled with preprocessor statements.

While I was at it I also made a few other improvements:

Serial output before:

����Connecting Wifi: Foobar
...........
WiFi connected
IP address: 
192.168.1.200
/youtube/v3/channels?part=statistics&id=UCezJOfu7OtqGzd5xrP3q6WA&key=supersecretkey
Tossing an unexpected character: 1
Tossing an unexpected character: d
Tossing an unexpected character: 9
Tossing an unexpected character: 
Tossing an unexpected character: 

Closing client
---------Stats---------
Subscriber Count: 14300
View Count: 1356962
Video Count: 127
------------------------

Serial output after:

����
Connecting to WiFi: Foobar
.........
WiFi connected!
IP address: 192.168.1.200

---------Stats---------
Subscriber Count: 14300
View Count: 1356962
Video Count: 127
------------------------

Other than the millis fix there should be no functional changes to the example itself for either board.

witnessmenow commented 3 years ago

Nice one @dmadison , thanks!