summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--advice.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/advice.cpp b/advice.cpp index f0f5014..c78c705 100644 --- a/advice.cpp +++ b/advice.cpp
@@ -303,13 +303,11 @@ void advice::run() const
303 303
304 std::cout << "Generated image!" << std::endl << "Tweeting..." << std::endl; 304 std::cout << "Generated image!" << std::endl << "Tweeting..." << std::endl;
305 305
306 std::string tweetText; 306 std::string tweetText = "How to " + title;
307 size_t tweetLim = 140 - client_->getConfiguration().getCharactersReservedPerMedia(); 307 size_t tweetLim = 140 - client_->getConfiguration().getCharactersReservedPerMedia();
308 if (title.length() > tweetLim) 308 if (tweetText.length() > tweetLim)
309 { 309 {
310 tweetText = title.substr(0, tweetLim - 1) + "…"; 310 tweetText = tweetText.substr(0, tweetLim - 1) + "…";
311 } else {
312 tweetText = title;
313 } 311 }
314 312
315 long media_id = client_->uploadMedia("image/png", (const char*) outputimg.data(), outputimg.length()); 313 long media_id = client_->uploadMedia("image/png", (const char*) outputimg.data(), outputimg.length());