aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Fourchan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/Fourchan.cpp')
-rw-r--r--src/plugins/Fourchan.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/Fourchan.cpp b/src/plugins/Fourchan.cpp
index 06728fe..073356b 100644
--- a/src/plugins/Fourchan.cpp
+++ b/src/plugins/Fourchan.cpp
@@ -1,7 +1,8 @@
#include "../../plugins/Fourchan.hpp"
+#include "../../include/DataView.hpp"
+#include "../../include/Storage.hpp"
#include <json/reader.h>
#include <string.h>
-#include "../../include/DataView.hpp"
#include <tidy.h>
#include <tidybuffio.h>
@@ -45,10 +46,17 @@ namespace QuickMedia {
}
PluginResult Fourchan::get_front_page(BodyItems &result_items) {
+#if 0
std::string server_response;
if(download_to_string(fourchan_url + "boards.json", server_response, {}, use_tor) != DownloadResult::OK)
return PluginResult::NET_ERR;
-
+#else
+ std::string server_response;
+ if(file_get_content("../../../boards.json", server_response) != 0) {
+ fprintf(stderr, "failed to read boards.json\n");
+ return PluginResult::ERR;
+ }
+#endif
Json::Value json_root;
Json::CharReaderBuilder json_builder;
std::unique_ptr<Json::CharReader> json_reader(json_builder.newCharReader());