44 int httpCode, ret = 0;
46 WiFiClientSecure *client =
new WiFiClientSecure;
47 client->setCACert(cert);
50 get_url.replace(
"{0}", channel_id);
51 get_url.replace(
"{1}", api_id);
55 https.begin(*client, get_url.c_str());
56 https.addHeader(
"Content-Type",
"application/json", 0, 0);
58 httpCode = https.GET();
60 if (httpCode == HTTP_CODE_OK) {
62 DEBUG.printf(
"[HTTP] GET SUCCESS\r\n");
67 https.writeToStream(&parser);
69 DEBUG.printf(
"[HTTP] Failed, error: %s\r\n", https.errorToString(httpCode).c_str());
77 DEBUG.printf(
"[HTTP] COMPLETED \r\n");
84 uint16_t wt, ht, prev_height = y, prev_width = x;
87 display.setFont(
font);
89 display.setTextSize(1);
93 display.getTextBounds(subscribers_str, 0, 0, &xt, &yt, &wt, &ht);
94 if (w == 0 || h == 0) {
97 display.setCursor(prev_width + 5, prev_height + ht + 4);
99 display.setCursor(prev_width + 5 + ((w - wt) / 2) + (
user_med_width / 2), prev_height + 4 + ((h - ht) / 2));
101 prev_height += 4 + (ht);
103 display.print(subscribers_str);
112 uint16_t wt, ht, prev_height = y, prev_width = x;
113 const int16_t block_width = 100;
116 display.setFont(
font);
118 display.setTextSize(1);
122 display.getTextBounds(views_str, 0, 0, &xt, &yt, &wt, &ht);
123 if (w == 0 || h == 0) {
126 display.setCursor(prev_width + 5, prev_height + ht + 4);
128 display.setCursor(prev_width + 5 + ((w - wt) / 2) + (
eye_med_width / 2), prev_height + 4 + ((h - ht) / 2));
130 prev_height += 4 + (ht);
132 display.print(views_str);