|
|
@ -30,7 +30,10 @@ Input getInput(int day, string key, bool useTestInput, int testFetchIndex) { |
|
|
|
string res = cpr::Get(cpr::Url{url}).text; |
|
|
|
string res = cpr::Get(cpr::Url{url}).text; |
|
|
|
size_t i1 = findAll(res, "<code>")[testFetchIndex]; |
|
|
|
size_t i1 = findAll(res, "<code>")[testFetchIndex]; |
|
|
|
size_t i2 = findAll(res, "</code>")[testFetchIndex]; |
|
|
|
size_t i2 = findAll(res, "</code>")[testFetchIndex]; |
|
|
|
file << res.substr(i1 + 6, i2 - (i1 + 6)); |
|
|
|
string codeContent = res.substr(i1 + 6, i2 - (i1 + 6)); |
|
|
|
|
|
|
|
removeAll(codeContent, "<em>"); |
|
|
|
|
|
|
|
removeAll(codeContent, "</em>"); |
|
|
|
|
|
|
|
file << codeContent; |
|
|
|
file.close(); |
|
|
|
file.close(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|