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