about summary refs log tree commit diff stats
path: root/src/user.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2016-05-20 15:34:44 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2016-05-20 15:34:44 -0400
commit0ccac89815ee92c69fefc148cfb272faf7309136 (patch)
tree228775a433018c8a5fd20f0ebb0f8446057b2112 /src/user.h
parentf465dce27cf0f07039e29d8975ad98939f0df3a9 (diff)
downloadlibtwittercpp-0ccac89815ee92c69fefc148cfb272faf7309136.tar.gz
libtwittercpp-0ccac89815ee92c69fefc148cfb272faf7309136.tar.bz2
libtwittercpp-0ccac89815ee92c69fefc148cfb272faf7309136.zip
Started implementing user streams
You can now start a user stream and end it yourself. If it disconnects abnormally, it will reconnect with a backoff as described by Twitter. Some data structures have some fields parsed now; tweets have IDs, text, and authors. Users have IDs, screen names, and names. Notifications from the stream are parsed completely. The ability to follow and unfollow users has also been added, as well as the ability to get a list of friends and followers, and to reply to a tweet.
Diffstat (limited to 'src/user.h')
-rw-r--r--src/user.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/user.h b/src/user.h new file mode 100644 index 0000000..0af40d6 --- /dev/null +++ b/src/user.h
@@ -0,0 +1,31 @@
1#ifndef USER_H_BF3AB38C
2#define USER_H_BF3AB38C
3
4#include <string>
5
6namespace twitter {
7
8 typedef unsigned long long user_id;
9
10 class user {
11 public:
12 user();
13 user(std::string data);
14
15 user_id getID() const;
16 std::string getScreenName() const;
17 std::string getName() const;
18
19 operator bool() const;
20 bool operator==(const user& other) const;
21
22 private:
23 bool _valid = false;
24 user_id _id;
25 std::string _screen_name;
26 std::string _name;
27 };
28
29};
30
31#endif /* end of include guard: USER_H_BF3AB38C */