diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-06-12 10:26:36 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-06-12 10:26:36 -0400 |
commit | c3cc76301d64320791f7097709ffcd36d7206266 (patch) | |
tree | b9aa1cfcbdd9070ac928605fb67753a6406dec9d | |
parent | 9fdcbee29350846db7f136b023da64bb2e6a93f5 (diff) | |
download | libtwittercpp-c3cc76301d64320791f7097709ffcd36d7206266.tar.gz libtwittercpp-c3cc76301d64320791f7097709ffcd36d7206266.tar.bz2 libtwittercpp-c3cc76301d64320791f7097709ffcd36d7206266.zip |
Added method to Tweet to get URL
-rw-r--r-- | src/tweet.cpp | 5 | ||||
-rw-r--r-- | src/tweet.h | 1 |
2 files changed, 6 insertions, 0 deletions
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 { | |||
126 | return _mentions; | 126 | return _mentions; |
127 | } | 127 | } |
128 | 128 | ||
129 | std::string tweet::getURL() const | ||
130 | { | ||
131 | return "https://twitter.com/" + _author.getScreenName() + "/statuses/" + std::to_string(_id); | ||
132 | } | ||
133 | |||
129 | tweet::operator bool() const | 134 | tweet::operator bool() const |
130 | { | 135 | { |
131 | return _valid; | 136 | 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 { | |||
27 | bool isRetweet() const; | 27 | bool isRetweet() const; |
28 | tweet getRetweet() const; | 28 | tweet getRetweet() const; |
29 | std::vector<std::pair<user_id, std::string>> getMentions() const; | 29 | std::vector<std::pair<user_id, std::string>> getMentions() const; |
30 | std::string getURL() const; | ||
30 | 31 | ||
31 | operator bool() const; | 32 | operator bool() const; |
32 | 33 | ||