From 64bafcbfacac900aef7c6845b5540d4dd33ebd9c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 3 Feb 2017 22:32:40 -0500 Subject: Added "How to" before text in tweet --- advice.cpp | 8 +++----- 1 file 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 std::cout << "Generated image!" << std::endl << "Tweeting..." << std::endl; - std::string tweetText; + std::string tweetText = "How to " + title; size_t tweetLim = 140 - client_->getConfiguration().getCharactersReservedPerMedia(); - if (title.length() > tweetLim) + if (tweetText.length() > tweetLim) { - tweetText = title.substr(0, tweetLim - 1) + "…"; - } else { - tweetText = title; + tweetText = tweetText.substr(0, tweetLim - 1) + "…"; } long media_id = client_->uploadMedia("image/png", (const char*) outputimg.data(), outputimg.length()); -- cgit 1.4.1