diff options
Diffstat (limited to 'capital.h')
-rw-r--r-- | capital.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/capital.h b/capital.h new file mode 100644 index 0000000..1f763db --- /dev/null +++ b/capital.h | |||
@@ -0,0 +1,45 @@ | |||
1 | #ifndef CAPITAL_H_09912EAE | ||
2 | #define CAPITAL_H_09912EAE | ||
3 | |||
4 | #include <random> | ||
5 | #include <string> | ||
6 | #include <verbly.h> | ||
7 | #include <stdexcept> | ||
8 | #include <memory> | ||
9 | #include <Magick++.h> | ||
10 | #include <twitter.h> | ||
11 | |||
12 | class capital { | ||
13 | public: | ||
14 | |||
15 | capital( | ||
16 | std::string configFile, | ||
17 | std::mt19937& rng); | ||
18 | |||
19 | void run() const; | ||
20 | |||
21 | private: | ||
22 | |||
23 | verbly::word getPicturedNoun() const; | ||
24 | |||
25 | Magick::Image getImageForNoun(verbly::word pictured) const; | ||
26 | |||
27 | std::string generateTweetText(verbly::word pictured) const; | ||
28 | |||
29 | void sendTweet(std::string text, Magick::Image image) const; | ||
30 | |||
31 | class could_not_get_image : public std::runtime_error { | ||
32 | public: | ||
33 | |||
34 | could_not_get_image() : std::runtime_error("Could not get image for noun") | ||
35 | { | ||
36 | } | ||
37 | }; | ||
38 | |||
39 | std::mt19937& rng_; | ||
40 | std::unique_ptr<verbly::database> database_; | ||
41 | std::unique_ptr<twitter::client> client_; | ||
42 | |||
43 | }; | ||
44 | |||
45 | #endif /* end of include guard: CAPITAL_H_09912EAE */ | ||