|
@@ -0,0 +1,32 @@
|
|
|
+#include <string>
|
|
|
+#include <iostream>
|
|
|
+#include <json.hpp>
|
|
|
+
|
|
|
+using json = nlohmann::json;
|
|
|
+
|
|
|
+namespace KIQUtils {
|
|
|
+
|
|
|
+void research_topic(std::string topic) {
|
|
|
+ std::cout << "researching topic: " << topic << std::endl;
|
|
|
+}
|
|
|
+
|
|
|
+void process_channel_info(json& json_obj) {
|
|
|
+ bool complete = false;
|
|
|
+ std::string topic_string{};
|
|
|
+ if (json_obj.size() > 0) {
|
|
|
+ for (const auto& [k, v] : json_obj.items()) {
|
|
|
+ if (k == "channelName") {
|
|
|
+ std::cout << "Parsed channel name: " << v << std::endl;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (k == "categoryName") {
|
|
|
+ std::string topic = v[0].get<std::string>();
|
|
|
+ topic_string = topic.substr(topic.find("https://en.wikipedia.org/wiki/") + 30);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (topic_string.size() > 0) {
|
|
|
+ research_topic(topic_string);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+};
|