about summary refs log tree commit diff stats
path: root/src/util.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-08-05 11:14:39 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-08-05 11:14:39 -0400
commit38203b745ae1903ba0804ed5532b78d255bea635 (patch)
tree52f57ce85e65361c534c461abc82fb1ed9768d49 /src/util.h
parent7c44fd17bb6be54a2ea4b60761e91053ca988977 (diff)
downloadlibtwittercpp-38203b745ae1903ba0804ed5532b78d255bea635.tar.gz
libtwittercpp-38203b745ae1903ba0804ed5532b78d255bea635.tar.bz2
libtwittercpp-38203b745ae1903ba0804ed5532b78d255bea635.zip
Added timeline polling
Because the streaming API will sunset on August 16th, it is essential to implement timeline polling so that the library can still be used to access tweets. This commit breaks the current API even for clients still using the streaming API because the OAuth connection data was pulled from twitter::client into twitter::auth. Other than that, almost everything works the same, and if a client wants to update their libtwitter++ within the next week and a half, they are free to.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/util.h b/src/util.h index 9084e81..8cbe054 100644 --- a/src/util.h +++ b/src/util.h
@@ -6,31 +6,25 @@
6#include <memory> 6#include <memory>
7 7
8namespace twitter { 8namespace twitter {
9 9
10 template <class InputIterator> 10 template <class InputIterator>
11 std::string implode(InputIterator first, InputIterator last, std::string delimiter) 11 std::string implode(InputIterator first, InputIterator last, std::string delimiter)
12 { 12 {
13 std::stringstream result; 13 std::stringstream result;
14 14
15 for (InputIterator it = first; it != last; it++) 15 for (InputIterator it = first; it != last; it++)
16 { 16 {
17 if (it != first) 17 if (it != first)
18 { 18 {
19 result << delimiter; 19 result << delimiter;
20 } 20 }
21 21
22 result << *it; 22 result << *it;
23 } 23 }
24 24
25 return result.str(); 25 return result.str();
26 } 26 }
27 27
28 template<typename T, typename... Args>
29 std::unique_ptr<T> make_unique(Args&&... args)
30 {
31 return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
32 }
33
34}; 28};
35 29
36#endif /* end of include guard: UTIL_H_440DEAA0 */ 30#endif /* end of include guard: UTIL_H_440DEAA0 */