· 8 years ago · Jun 11, 2017, 12:06 PM
1type
2 TTwitter = class(TObject)
3 private
4 FAuthorized: boolean;
5 FSource: string;
6 FTwitterClient: string;
7 FTwitterClientVersion: string;
8 FTwitterClientURL: string;
9 FUserName: string;
10 FPassword: string;
11 FConsumer: TOAuthConsumer;
12 FToken: TOAuthToken;
13 FRequest: TOAuthRequest;
14 FHMAC: TOAuthSignatureMethod_HMAC_SHA1;
15 FKey: string;
16 FSecret: string;
17 FOAuth_token: string;
18 FOAuth_token_secret: string;
19 FAuthHeader: string;
20 procedure SetSource(const Value: string);
21 procedure SetTwitterClient(const Value: string);
22 procedure SetTwitterClientVersion(const Value: string);
23 procedure SetTwitterCLientURL(const Value: string);
24 function GetRequestsCount: integer;
25 function GetResetLimitTime: TDateTime;
26 procedure AddCustomHeader(Sender: TObject; const Method: String;
27 Headers: TStrings);
28 procedure CheckResponce(const Responce:string);
29 public
30 constructor Create;
31 procedure SetAccountInfo;
32 procedure GetRateLimits;
33 procedure GetFollowersIds;
34 function GetCurrentHashTags:TStringList;
35 function POSTCommand(URL: string; Params: TStringList): string;
36 function GETCommand(URL: string): string;
37 function Update(const Text: string): string;
38 property Source: string read FSource write SetSource;
39 property TwitterClient: string read FTwitterClient write SetTwitterClient;
40 property TwitterClientVersion: string read FTwitterClientVersion write
41 SetTwitterClientVersion;
42 property TwitterClientURL: string read FTwitterClientURL write
43 SetTwitterCLientURL;
44 property Consumer: TOAuthConsumer read FConsumer write FConsumer;
45 property Token: TOAuthToken read FToken write FToken;
46 property Request: TOAuthRequest read FRequest write FRequest;
47 property HMAC: TOAuthSignatureMethod_HMAC_SHA1 read FHMAC write FHMAC;
48 property Key: string read FKey write FKey;
49 property Secret: string read FSecret write FSecret;
50 property OAuth_token: string read FOAuth_token write FOAuth_token;
51 property OAuth_token_secret
52 : string read FOAuth_token_secret write FOAuth_token_secret;
53 property Authorized: boolean read FAuthorized write FAuthorized;
54 end;