diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-12-13 19:36:26 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-12-13 19:36:26 -0500 |
commit | a56e585703a12e30af6b62e5e6ac8a9891d7610f (patch) | |
tree | da00a505efbea35b14edc9bf0b2101319addbfe0 | |
parent | 736d2dbcffc30f0f373a5fa0d324b2e59322f741 (diff) | |
download | fruity-a56e585703a12e30af6b62e5e6ac8a9891d7610f.tar.gz fruity-a56e585703a12e30af6b62e5e6ac8a9891d7610f.tar.bz2 fruity-a56e585703a12e30af6b62e5e6ac8a9891d7610f.zip |
Bot now takes path to config file as argument
That config file now also has to contain the path to the verbly datafile.
-rw-r--r-- | owo.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/owo.cpp b/owo.cpp index d6b3043..f66e689 100644 --- a/owo.cpp +++ b/owo.cpp | |||
@@ -8,7 +8,14 @@ | |||
8 | 8 | ||
9 | int main(int argc, char** argv) | 9 | int main(int argc, char** argv) |
10 | { | 10 | { |
11 | YAML::Node config = YAML::LoadFile("config.yml"); | 11 | if (argc != 2) |
12 | { | ||
13 | std::cout << "usage: owo [configfile]" << std::endl; | ||
14 | return -1; | ||
15 | } | ||
16 | |||
17 | std::string configfile(argv[1]); | ||
18 | YAML::Node config = YAML::LoadFile(configfile); | ||
12 | 19 | ||
13 | twitter::auth auth; | 20 | twitter::auth auth; |
14 | auth.setConsumerKey(config["consumer_key"].as<std::string>()); | 21 | auth.setConsumerKey(config["consumer_key"].as<std::string>()); |
@@ -18,7 +25,7 @@ int main(int argc, char** argv) | |||
18 | 25 | ||
19 | twitter::client client(auth); | 26 | twitter::client client(auth); |
20 | 27 | ||
21 | verbly::data database {"data.sqlite3"}; | 28 | verbly::data database {config["verbly_datafile"].as<std::string>()}; |
22 | 29 | ||
23 | verbly::noun bp = database.nouns().with_wnid(105220461).run().front(); // body part | 30 | verbly::noun bp = database.nouns().with_wnid(105220461).run().front(); // body part |
24 | verbly::noun pp = database.nouns().with_wnid(104723816).run().front(); // quality | 31 | verbly::noun pp = database.nouns().with_wnid(104723816).run().front(); // quality |