From 0ccac89815ee92c69fefc148cfb272faf7309136 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 20 May 2016 15:34:44 -0400 Subject: 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. --- src/user.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/user.h (limited to 'src/user.h') 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 @@ +#ifndef USER_H_BF3AB38C +#define USER_H_BF3AB38C + +#include + +namespace twitter { + + typedef unsigned long long user_id; + + class user { + public: + user(); + user(std::string data); + + user_id getID() const; + std::string getScreenName() const; + std::string getName() const; + + operator bool() const; + bool operator==(const user& other) const; + + private: + bool _valid = false; + user_id _id; + std::string _screen_name; + std::string _name; + }; + +}; + +#endif /* end of include guard: USER_H_BF3AB38C */ -- cgit 1.4.1