This commit is contained in:
parent
87c2e2e01c
commit
a6ff11ff71
@ -1,6 +1,8 @@
|
||||
#include "timetable.h"
|
||||
#include <cstdint>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "net.h"
|
||||
#include <fstream>
|
||||
|
||||
using nlohmann::json;
|
||||
|
||||
@ -14,9 +16,17 @@ using nlohmann::json;
|
||||
|
||||
void timetable_page() {
|
||||
// DONT FORGET TO UNCOMMENT
|
||||
json resp_from_api = bakaapi::get_data_from_endpoint("api/3/marks");
|
||||
// std::ifstream f("test-data/marks3.json");
|
||||
// json resp_from_api = json::parse(f);
|
||||
// json resp_from_api = bakaapi::get_data_from_endpoint("api/3/timetable/actual");
|
||||
std::ifstream f("test-data/timetable.json");
|
||||
json resp_from_api = json::parse(f);
|
||||
|
||||
// calculate table size
|
||||
|
||||
uint8_t column_number = 0;
|
||||
for(uint8_t i = 0; i < resp_from_api["Days"].size(); i++) {
|
||||
(resp_from_api["Days"][i]["Atoms"].size() > column_number) ? (column_number = resp_from_api["Days"][i]["Atoms"].size());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user