diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-03-03 18:17:37 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-03-03 18:17:37 -0500 |
commit | 7ba70196fd05a893a851f24a07868e3a1e9a7818 (patch) | |
tree | df12ddf03d142745c20056002a6cf7db790645b5 /grunge.h | |
download | grunge-7ba70196fd05a893a851f24a07868e3a1e9a7818.tar.gz grunge-7ba70196fd05a893a851f24a07868e3a1e9a7818.tar.bz2 grunge-7ba70196fd05a893a851f24a07868e3a1e9a7818.zip |
Created bot
Diffstat (limited to 'grunge.h')
-rw-r--r-- | grunge.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/grunge.h b/grunge.h new file mode 100644 index 0000000..5f95442 --- /dev/null +++ b/grunge.h | |||
@@ -0,0 +1,49 @@ | |||
1 | #ifndef GRUNGE_H | ||
2 | #define GRUNGE_H | ||
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 | |||
12 | class grunge { | ||
13 | public: | ||
14 | |||
15 | grunge( | ||
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 | Magick::Image pixelateImage(Magick::Image image) const; | ||
28 | |||
29 | Magick::Image pastelizeImage(Magick::Image image) const; | ||
30 | |||
31 | std::string generateTweetText(verbly::word pictured) const; | ||
32 | |||
33 | void sendTweet(std::string text, Magick::Image image) const; | ||
34 | |||
35 | class could_not_get_images : public std::runtime_error { | ||
36 | public: | ||
37 | |||
38 | could_not_get_images() : std::runtime_error("Could not get images for noun") | ||
39 | { | ||
40 | } | ||
41 | }; | ||
42 | |||
43 | std::mt19937& rng_; | ||
44 | std::unique_ptr<verbly::database> database_; | ||
45 | std::unique_ptr<twitter::client> client_; | ||
46 | |||
47 | }; | ||
48 | |||
49 | #endif | ||