-
Notifications
You must be signed in to change notification settings - Fork 80
/
facebook.h
64 lines (41 loc) · 1.19 KB
/
facebook.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef FB_H
#define FB_H
#include <iostream>
#include <fstream>
#include <sstream>
#include <curl/curl.h>
#include <syslog.h>
#include <string.h>
#include "gumbo.h"
class FacebookClient {
public:
FacebookClient();
~FacebookClient();
bool authenticate( const char*, const char* );
double getFriendID( const char* );
size_t curl_write( void *, size_t, size_t, void *);
void sendPacketTo( double, const char*, int );
void readPacketsFrom( double );
void listClients();
double friendID;
protected:
CURL* curl;
void cleanup();
std::string pageBuffer;
std::string sendRequest( const char* );
void extractFormData(GumboNode*, curl_httppost*, curl_httppost*);
void extractFormData(GumboNode*, char*, char* );
void extractLinks(GumboNode* );
void extractClientList(GumboNode* );
void extractMessages(GumboNode* );
struct curl_httppost *loginForm;
struct curl_httppost *loginFormLastPtr;
struct curl_httppost *messageForm;
struct curl_httppost *messageFormLastPtr;
std::string rawCookies;
struct curl_slist *cookies;
char fb_dtsg[64];
void fillCSRF();
void fillChatCSRF( double );
};
#endif