summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-02-03 22:32:40 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-02-03 22:32:40 -0500
commit64bafcbfacac900aef7c6845b5540d4dd33ebd9c (patch)
tree38ea701e18fa5c58dde5960cefbf34dfbb3c19ba
parent8a68ce34d7017619c8cc5b39dc5099bfa26e5225 (diff)
downloadadvice-64bafcbfacac900aef7c6845b5540d4dd33ebd9c.tar.gz
advice-64bafcbfacac900aef7c6845b5540d4dd33ebd9c.tar.bz2
advice-64bafcbfacac900aef7c6845b5540d4dd33ebd9c.zip
Added "How to" before text in tweet
-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());