File: twitter_api.h

package info (click to toggle)
pidgin-twitter 0.9.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 660 kB
  • ctags: 452
  • sloc: ansic: 6,383; makefile: 86; sh: 45
file content (50 lines) | stat: -rw-r--r-- 1,961 bytes parent folder | download | duplicates (2)
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
#ifndef _PIDGIN_TWITTER_TWITTER_API_H_
#define _PIDGIN_TWITTER_TWITTER_API_H_

#include <cipher.h> /* from libpurple */
#include <request.h>
#include <math.h>

/* twitter API specific macros */
#define TWITTER_BASE_URL  "http://twitter.com"
#define TWITTER_API_BASE_URL "http://api.twitter.com"
#define REQUEST_TOKEN_URL "http://twitter.com/oauth/request_token"
#define ACCESS_TOKEN_URL  "http://twitter.com/oauth/access_token"
#define AUTHORIZE_URL     "http://twitter.com/oauth/authorize"

#define TWITTER_STATUS_GET "GET /1/statuses/home_timeline.xml?%s HTTP/1.1\r\n" \
    "Host: api.twitter.com\r\n"                                          \
    "User-Agent: pidgin-twitter\r\n"

#define TWITTER_STATUS_POST "POST /1/statuses/update.xml HTTP/1.1\r\n" \
    "Host: api.twitter.com\r\n"                                          \
    "User-Agent: pidgin-twitter\r\n"                                 \
    "Content-Length: %d\r\n"

#define TWITTER_FAV_POST "POST /1/favorites/create/%llu.xml HTTP/1.1\r\n" \
    "Host: api.twitter.com\r\n"                                          \
    "User-Agent: pidgin-twitter\r\n" \
    "Content-Length: %d\r\n"

#define TWITTER_RETWEET_POST "POST /1/statuses/retweet/%llu.xml HTTP/1.1\r\n" \
    "Host: api.twitter.com\r\n"                                          \
    "User-Agent: pidgin-twitter\r\n" \
    "Content-Length: %d\r\n"

#define TWITTER_STATUS_FORMAT "&source=pidgintwitter&status=%s"

#define TWITTER_DEFAULT_INTERVAL (60)
#define TWITTER_OLD_DEFAULT_ICON_URL "http://static.twitter.com/images/default_profile_bigger.png"
#define TWITTER_DEFAULT_ICON_URL "http://s.twimg.com/images/default_profile_3_bigger.png"

#define TWITTER_DEFAULT_RETRIEVE_COUNT (20)


/* prototypes */
void post_status_with_api(PurpleAccount *account, char **buffer);
gboolean get_status_with_api(gpointer data);
void fav_with_api(guint64 id);
void retweet_with_api(guint64 id);
void signed_on_cb(PurpleConnection *gc);

#endif