#ifdef __UTILS__ #include #endif #include #include #include #include #include #include String ver("v0.0.1"); String localIP("Unconnected"); String NAME = "仙女小可"; //改成自己的名字 static String UID = "450115492"; //改成自己的UID static String followerUrl = "http://api.bilibili.com/x/relation/stat?vmid=" + UID; // 粉丝数 static String viewAndLikesUrl = "http://api.bilibili.com/x/space/upstat?mid=" + UID; // 播放数、点赞数 long follower_hist = 0; // 历史粉丝数 long follower = 0; // 粉丝数 long view = 0; // 播放数 long likes = 0; // 获赞数 static DynamicJsonDocument jsonBuffer(256); void getFollower(String url) { HTTPClient http; http.begin(url); int res_code = http.GET(); if( res_code == 200 ) { String res = http.getString(); DeserializationError error = deserializeJson(jsonBuffer, res); if( error ) { Serial.print(F("deserializeJson() failed: ")); Serial.println(error.f_str()); return; } follower_hist = follower; follower = jsonBuffer["data"]["follower"]; } else { Serial.printf("[HTTP] GET... failed, error: %d\n", res_code); } http.end(); } void getViewAndLikes(String url) { }