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/tweet.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/tweet.h') diff --git a/src/tweet.h b/src/tweet.h index e099579..137776c 100644 --- a/src/tweet.h +++ b/src/tweet.h @@ -1,19 +1,29 @@ #ifndef TWEET_H_CE980721 #define TWEET_H_CE980721 -#include - -using nlohmann::json; +#include +#include "user.h" namespace twitter { + typedef unsigned long long tweet_id; + class tweet { public: tweet(); - tweet(const json& _data); + tweet(std::string data); + + tweet_id getID() const; + std::string getText() const; + const user& getAuthor() const; + + operator bool() const; private: bool _valid; + tweet_id _id; + std::string _text; + user _author; }; }; -- cgit 1.4.1