diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2022-12-23 11:09:58 +0000 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2022-12-23 11:09:58 +0000 |
commit | a76e81ee8bcbad87c9eb58cdb25452cae65bd0c7 (patch) | |
tree | 4f677cd679bb7374b022238d55d49dba81b7313f /difference.h | |
parent | 31770500a918bccf7b624262bc7d444cc2dd8a1d (diff) | |
download | difference-a76e81ee8bcbad87c9eb58cdb25452cae65bd0c7.tar.gz difference-a76e81ee8bcbad87c9eb58cdb25452cae65bd0c7.tar.bz2 difference-a76e81ee8bcbad87c9eb58cdb25452cae65bd0c7.zip |
Bot is now a Mastodon bot
Diffstat (limited to 'difference.h')
-rw-r--r-- | difference.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/difference.h b/difference.h index bccf9ab..6a03f84 100644 --- a/difference.h +++ b/difference.h | |||
@@ -7,8 +7,9 @@ | |||
7 | #include <utility> | 7 | #include <utility> |
8 | #include <verbly.h> | 8 | #include <verbly.h> |
9 | #include <stdexcept> | 9 | #include <stdexcept> |
10 | #include <twitter.h> | 10 | #include <mastodonpp/mastodonpp.hpp> |
11 | #include <memory> | 11 | #include <memory> |
12 | #include "imagenet.h" | ||
12 | 13 | ||
13 | class difference { | 14 | class difference { |
14 | public: | 15 | public: |
@@ -26,8 +27,6 @@ private: | |||
26 | std::pair<Magick::Image, Magick::Image> | 27 | std::pair<Magick::Image, Magick::Image> |
27 | getImagesForNoun(verbly::word pictured) const; | 28 | getImagesForNoun(verbly::word pictured) const; |
28 | 29 | ||
29 | Magick::Image getImageAtUrl(std::string url) const; | ||
30 | |||
31 | std::pair<verbly::word, verbly::word> getOppositeIdentifiers() const; | 30 | std::pair<verbly::word, verbly::word> getOppositeIdentifiers() const; |
32 | 31 | ||
33 | Magick::Image composeImage( | 32 | Magick::Image composeImage( |
@@ -36,9 +35,9 @@ private: | |||
36 | Magick::Image image2, | 35 | Magick::Image image2, |
37 | verbly::word word2) const; | 36 | verbly::word word2) const; |
38 | 37 | ||
39 | std::string generateTweetText(verbly::word word1, verbly::word word2) const; | 38 | std::string generatePostText(verbly::word word1, verbly::word word2) const; |
40 | 39 | ||
41 | void sendTweet(std::string text, Magick::Image image) const; | 40 | void sendPost(std::string text, Magick::Image image) const; |
42 | 41 | ||
43 | class could_not_get_images : public std::runtime_error { | 42 | class could_not_get_images : public std::runtime_error { |
44 | public: | 43 | public: |
@@ -50,8 +49,11 @@ private: | |||
50 | 49 | ||
51 | std::mt19937& rng_; | 50 | std::mt19937& rng_; |
52 | std::unique_ptr<verbly::database> database_; | 51 | std::unique_ptr<verbly::database> database_; |
53 | std::unique_ptr<twitter::client> client_; | 52 | std::unique_ptr<mastodonpp::Instance> instance_; |
53 | std::unique_ptr<mastodonpp::Connection> connection_; | ||
54 | std::unique_ptr<imagenet> imagenet_; | ||
54 | std::string fontfile_; | 55 | std::string fontfile_; |
56 | std::string tempfile_; | ||
55 | 57 | ||
56 | }; | 58 | }; |
57 | 59 | ||