diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-05-31 09:55:58 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-05-31 09:55:58 -0400 |
commit | aceb3cc33ee78cce1077252aff8a8808a3195ff1 (patch) | |
tree | 74afeee58c942f827c4f7830c20b206cb8c7e36b /src/client.cpp | |
parent | 501880160ac69f90143bc38add541731a9242ab0 (diff) | |
download | libtwittercpp-aceb3cc33ee78cce1077252aff8a8808a3195ff1.tar.gz libtwittercpp-aceb3cc33ee78cce1077252aff8a8808a3195ff1.tar.bz2 libtwittercpp-aceb3cc33ee78cce1077252aff8a8808a3195ff1.zip |
Added ability to get configuration
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp index b7d1624..cf2b5c4 100644 --- a/src/client.cpp +++ b/src/client.cpp | |||
@@ -321,6 +321,22 @@ namespace twitter { | |||
321 | return _current_user; | 321 | return _current_user; |
322 | } | 322 | } |
323 | 323 | ||
324 | configuration client::getConfiguration() | ||
325 | { | ||
326 | if (!_configuration || (difftime(time(NULL), _last_configuration_update) > 60*60*24)) | ||
327 | { | ||
328 | long response_code; | ||
329 | std::string response_data; | ||
330 | if (performGet("https://api.twitter.com/1.1/help/configuration.json", response_code, response_data)) | ||
331 | { | ||
332 | _configuration = configuration(response_data); | ||
333 | _last_configuration_update = time(NULL); | ||
334 | } | ||
335 | } | ||
336 | |||
337 | return _configuration; | ||
338 | } | ||
339 | |||
324 | response client::getFriends(std::set<user_id>& _ret) | 340 | response client::getFriends(std::set<user_id>& _ret) |
325 | { | 341 | { |
326 | if (!_current_user) | 342 | if (!_current_user) |