From c3cc76301d64320791f7097709ffcd36d7206266 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 12 Jun 2016 10:26:36 -0400 Subject: Added method to Tweet to get URL --- src/tweet.cpp | 5 +++++ src/tweet.h | 1 + 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/tweet.cpp b/src/tweet.cpp index 2927018..193df6e 100644 --- a/src/tweet.cpp +++ b/src/tweet.cpp @@ -126,6 +126,11 @@ namespace twitter { return _mentions; } + std::string tweet::getURL() const + { + return "https://twitter.com/" + _author.getScreenName() + "/statuses/" + std::to_string(_id); + } + tweet::operator bool() const { return _valid; diff --git a/src/tweet.h b/src/tweet.h index 387f73a..74d73d2 100644 --- a/src/tweet.h +++ b/src/tweet.h @@ -27,6 +27,7 @@ namespace twitter { bool isRetweet() const; tweet getRetweet() const; std::vector> getMentions() const; + std::string getURL() const; operator bool() const; -- cgit 1.4.1