From aceb3cc33ee78cce1077252aff8a8808a3195ff1 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 31 May 2016 09:55:58 -0400 Subject: Added ability to get configuration --- src/client.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/client.cpp') 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 { return _current_user; } + configuration client::getConfiguration() + { + if (!_configuration || (difftime(time(NULL), _last_configuration_update) > 60*60*24)) + { + long response_code; + std::string response_data; + if (performGet("https://api.twitter.com/1.1/help/configuration.json", response_code, response_data)) + { + _configuration = configuration(response_data); + _last_configuration_update = time(NULL); + } + } + + return _configuration; + } + response client::getFriends(std::set& _ret) { if (!_current_user) -- cgit 1.4.1