From bd8ff4083d41417f014241ddb94e43b39bee6080 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 10 Apr 2017 11:35:55 -0400 Subject: Updated verbly (new API) Also updated libtwitter++, and blacklisted some problematic images. --- difference.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 difference.h (limited to 'difference.h') diff --git a/difference.h b/difference.h new file mode 100644 index 0000000..bccf9ab --- /dev/null +++ b/difference.h @@ -0,0 +1,58 @@ +#ifndef DIFFERENCE_H_081276A3 +#define DIFFERENCE_H_081276A3 + +#include +#include +#include +#include +#include +#include +#include +#include + +class difference { +public: + + difference( + std::string configFile, + std::mt19937& rng); + + void run() const; + +private: + + verbly::word getPicturedNoun() const; + + std::pair + getImagesForNoun(verbly::word pictured) const; + + Magick::Image getImageAtUrl(std::string url) const; + + std::pair getOppositeIdentifiers() const; + + Magick::Image composeImage( + Magick::Image image1, + verbly::word word1, + Magick::Image image2, + verbly::word word2) const; + + std::string generateTweetText(verbly::word word1, verbly::word word2) const; + + void sendTweet(std::string text, Magick::Image image) const; + + class could_not_get_images : public std::runtime_error { + public: + + could_not_get_images() : std::runtime_error("Could not get images for noun") + { + } + }; + + std::mt19937& rng_; + std::unique_ptr database_; + std::unique_ptr client_; + std::string fontfile_; + +}; + +#endif /* end of include guard: DIFFERENCE_H_081276A3 */ -- cgit 1.4.1