#include "../shared/DatabaseWithRetry.h" #include "../shared/TwoDLookup.h" #include "../shared/GlobalConfigFile.h" int main(int argc, char *argv[]) { addConfigItemsFromCommandLine(argv + 1); configItemsComplete(); TwoDArray table; DatabaseWithRetry database("@live", "live"); for (MysqlResultRef result = database.tryQueryUntilSuccess("SELECT DISTINCT d_symbol " "FROM alerts_daily " "WHERE d_symbol LIKE '%.CA_'"); result->rowIsValid(); result->nextRow()) { const std::string ourSymbol = result->getStringField(0); if (ourSymbol.size() < 1) continue; const std::string stSymbol(ourSymbol, 0, ourSymbol.size() - 1); table.add("ours", stSymbol, ourSymbol); } table.writeToCSV(getConfigItem("translation_table", "stocktwits_translation.csv")); }