about summary refs log tree commit diff stats
path: root/src/tweet.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/tweet.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/tweet.h')
-rw-r--r--src/tweet.h18
1 files changed, 14 insertions, 4 deletions
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 @@
1#ifndef TWEET_H_CE980721 1#ifndef TWEET_H_CE980721
2#define TWEET_H_CE980721 2#define TWEET_H_CE980721
3 3
4#include <json.hpp> 4#include <string>
5 5#include "user.h"
6using nlohmann::json;
7 6
8namespace twitter { 7namespace twitter {
9 8
9 typedef unsigned long long tweet_id;
10
10 class tweet { 11 class tweet {
11 public: 12 public:
12 tweet(); 13 tweet();
13 tweet(const json& _data); 14 tweet(std::string data);
15
16 tweet_id getID() const;
17 std::string getText() const;
18 const user& getAuthor() const;
19
20 operator bool() const;
14 21
15 private: 22 private:
16 bool _valid; 23 bool _valid;
24 tweet_id _id;
25 std::string _text;
26 user _author;
17 }; 27 };
18 28
19}; 29};