Mercurial > pidgin-twitter
comparison twitter_api.h @ 355:0fe895195132
implement OAuth authentication.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Thu, 26 Aug 2010 15:05:33 +0900 |
parents | 2e37e715e4a6 |
children | 732de90812d8 |
comparison
equal
deleted
inserted
replaced
354:ff078879e68e | 355:0fe895195132 |
---|---|
1 #ifndef _PIDGIN_TWITTER_TWITTER_API_H_ | 1 #ifndef _PIDGIN_TWITTER_TWITTER_API_H_ |
2 #define _PIDGIN_TWITTER_TWITTER_API_H_ | 2 #define _PIDGIN_TWITTER_TWITTER_API_H_ |
3 | 3 |
4 #include <cipher.h> /* from libpurple */ | |
5 #include <request.h> | |
6 //#include <conversation.h> | |
7 #include <math.h> | |
8 | |
9 /* twitter API specific macros */ | |
10 #define TWITTER_BASE_URL "http://twitter.com" | |
11 #define TWITTER_API_BASE_URL "http://api.twitter.com" | |
12 | |
13 #define TWITTER_STATUS_GET "GET /1/statuses/home_timeline.xml?%s HTTP/1.1\r\n" \ | |
14 "Host: api.twitter.com\r\n" \ | |
15 "User-Agent: pidgin-twitter\r\n" | |
16 | |
17 #define TWITTER_STATUS_POST "POST /1/statuses/update.xml HTTP/1.1\r\n" \ | |
18 "Host: api.twitter.com\r\n" \ | |
19 "User-Agent: pidgin-twitter\r\n" \ | |
20 "Content-Length: %d\r\n" | |
21 | |
22 #define TWITTER_FAV_POST "POST /1/favorites/create/%llu.xml HTTP/1.1\r\n" \ | |
23 "Host: api.twitter.com\r\n" \ | |
24 "User-Agent: pidgin-twitter\r\n" \ | |
25 "Content-Length: %d\r\n" | |
26 | |
27 #define TWITTER_RETWEET_POST "POST /1/statuses/retweet/%llu.xml HTTP/1.1\r\n" \ | |
28 "Host: api.twitter.com\r\n" \ | |
29 "User-Agent: pidgin-twitter\r\n" \ | |
30 "Content-Length: %d\r\n" | |
31 | |
32 #define TWITTER_STATUS_FORMAT "&source=pidgintwitter&status=%s" | |
33 //#define TWITTER_REPLY_FORMAT "&source=pidgintwitter&status=%s&in_reply_to_status_id=%llu" | |
34 | |
35 #define TWITTER_DEFAULT_INTERVAL (60) | |
36 #define TWITTER_OLD_DEFAULT_ICON_URL "http://static.twitter.com/images/default_profile_bigger.png" | |
37 #define TWITTER_DEFAULT_ICON_URL "http://s.twimg.com/images/default_profile_3_bigger.png" | |
38 | |
39 #define TWITTER_DEFAULT_RETRIEVE_COUNT (20) | |
40 | |
41 | |
42 /* prototypes */ | |
4 void post_status_with_api(PurpleAccount *account, char **buffer); | 43 void post_status_with_api(PurpleAccount *account, char **buffer); |
5 gboolean get_status_with_api(gpointer data); | 44 gboolean get_status_with_api(gpointer data); |
6 void fav_with_api(guint64 id); | 45 void fav_with_api(guint64 id); |
7 void retweet_with_api(guint64 id); | 46 void retweet_with_api(guint64 id); |
8 void signed_on_cb(PurpleConnection *gc); | 47 void signed_on_cb(PurpleConnection *gc); |