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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
/* aww yeah creating some crazy .h file
*/
#ifndef TC2_H
#define TC2_H
//#include "proto.h"
#include "stdafx.h"
#include "twitter.h"
using namespace std;
//typedef std::map<wstring, wstring> OAuthParameters;
wstring getHostName();
wstring getAccessUrl();
wstring getAuthorizeUrl();
wstring getRequestUrl();
wstring getUserTimelineUrl();
wstring getConsumerKey();
wstring getConsumerSecret();
//wstring UrlGetQuery( const wstring& url );
OAuthParameters ParseQueryString( const wstring& url );
wstring OAuthCreateNonce();
wstring OAuthCreateTimestamp();
string HMACSHA1( const string& keyBytes, const string& data );
wstring Base64String( const string& hash );
string char2hex( char dec );
string urlencode(const string &c);
wstring UrlEncode( const wstring& url );
wstring OAuthCreateSignature( const wstring& signatureBase, const wstring& consumerSecret, const wstring& requestTokenSecret );
wstring OAuthConcatenateRequestElements( const wstring& httpMethod, wstring url, const wstring& parameters );
wstring OAuthNormalizeRequestParameters( const OAuthParameters& requestParameters );
//wstring OAuthNormalizeUrl( const wstring& url );
/*OAuthParameters BuildSignedOAuthParameters( const OAuthParameters& requestParameters,
const wstring& url,
const wstring& httpMethod,
const wstring& consumerKey,
const wstring& consumerSecret,
const wstring& requestToken,
const wstring& requestTokenSecret,
const wstring& pin );*/
/*wstring OAuthWebRequestSubmit(
const OAuthParameters& parameters,
const wstring& url
);*/
// OAuthWebRequest used for all OAuth related queries
//
// consumerKey and consumerSecret - must be provided for every call, they identify the application
// oauthToken and oauthTokenSecret - need to be provided for every call, except for the first token request before authorizing
// pin - only used during authorization, when the user enters the PIN they received from the twitter website
/*wstring OAuthWebRequestSubmit(
const wstring& url,
const wstring& httpMethod,
const wstring& consumerKey,
const wstring& consumerSecret,
const wstring& oauthToken = L"",
const wstring& oauthTokenSecret = L"",
const wstring& pin = L""
);*/
int testfunc(int argc, _TCHAR* argv[]);
#endif
|