1 | /***************************************************************************\ |
---|
2 | * * |
---|
3 | * BitlBee - An IRC to IM gateway * |
---|
4 | * Simple module to facilitate twitter functionality. * |
---|
5 | * * |
---|
6 | * Copyright 2009 Geert Mulders <g.c.w.m.mulders@gmail.com> * |
---|
7 | * * |
---|
8 | * This library is free software; you can redistribute it and/or * |
---|
9 | * modify it under the terms of the GNU Lesser General Public * |
---|
10 | * License as published by the Free Software Foundation, version * |
---|
11 | * 2.1. * |
---|
12 | * * |
---|
13 | * This library is distributed in the hope that it will be useful, * |
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * |
---|
16 | * Lesser General Public License for more details. * |
---|
17 | * * |
---|
18 | * You should have received a copy of the GNU Lesser General Public License * |
---|
19 | * along with this library; if not, write to the Free Software Foundation, * |
---|
20 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * |
---|
21 | * * |
---|
22 | ****************************************************************************/ |
---|
23 | |
---|
24 | |
---|
25 | #ifndef _TWITTER_LIB_H |
---|
26 | #define _TWITTER_LIB_H |
---|
27 | |
---|
28 | #include "nogaim.h" |
---|
29 | #include "twitter_http.h" |
---|
30 | |
---|
31 | #define TWITTER_API_URL "http://twitter.com" |
---|
32 | |
---|
33 | /* Status URLs */ |
---|
34 | #define TWITTER_STATUS_UPDATE_URL TWITTER_API_URL "/statuses/update.xml" |
---|
35 | #define TWITTER_STATUS_SHOW_URL TWITTER_API_URL "/statuses/show/" |
---|
36 | #define TWITTER_STATUS_DESTROY_URL TWITTER_API_URL "/statuses/destroy/" |
---|
37 | |
---|
38 | /* Timeline URLs */ |
---|
39 | #define TWITTER_PUBLIC_TIMELINE_URL TWITTER_API_URL "/statuses/public_timeline.xml" |
---|
40 | #define TWITTER_FEATURED_USERS_URL TWITTER_API_URL "/statuses/featured.xml" |
---|
41 | #define TWITTER_FRIENDS_TIMELINE_URL TWITTER_API_URL "/statuses/friends_timeline.xml" |
---|
42 | #define TWITTER_HOME_TIMELINE_URL TWITTER_API_URL "/statuses/home_timeline.xml" |
---|
43 | #define TWITTER_MENTIONS_URL TWITTER_API_URL "/statuses/mentions.xml" |
---|
44 | #define TWITTER_USER_TIMELINE_URL TWITTER_API_URL "/statuses/user_timeline.xml" |
---|
45 | |
---|
46 | /* Users URLs */ |
---|
47 | #define TWITTER_SHOW_USERS_URL TWITTER_API_URL "/users/show.xml" |
---|
48 | #define TWITTER_SHOW_FRIENDS_URL TWITTER_API_URL "/statuses/friends.xml" |
---|
49 | #define TWITTER_SHOW_FOLLOWERS_URL TWITTER_API_URL "/statuses/followers.xml" |
---|
50 | |
---|
51 | /* Direct messages URLs */ |
---|
52 | #define TWITTER_DIRECT_MESSAGES_URL TWITTER_API_URL "/direct_messages.xml" |
---|
53 | #define TWITTER_DIRECT_MESSAGENEW_URL TWITTER_API_URL "/direct_messages/new.xml" |
---|
54 | #define TWITTER_DIRECT_MESSAGESSENT_URL TWITTER_API_URL "/direct_messages/sent.xml" |
---|
55 | #define TWITTER_DIRECT_MESSAGEDESTROY_URL TWITTER_API_URL "/direct_messages/destroy/" |
---|
56 | |
---|
57 | /* Friendships URLs */ |
---|
58 | #define TWITTER_FRIENDSHIPS_CREATE_URL TWITTER_API_URL "/friendships/create.xml" |
---|
59 | #define TWITTER_FRIENDSHIPS_DESTROY_URL TWITTER_API_URL "/friendships/destroy.xml" |
---|
60 | #define TWITTER_FRIENDSHIPS_SHOW_URL TWITTER_API_URL "/friendships/show.xml" |
---|
61 | |
---|
62 | /* Social graphs URLs */ |
---|
63 | #define TWITTER_FRIENDS_IDS_URL TWITTER_API_URL "/friends/ids.xml" |
---|
64 | #define TWITTER_FOLLOWERS_IDS_URL TWITTER_API_URL "/followers/ids.xml" |
---|
65 | |
---|
66 | /* Account URLs */ |
---|
67 | #define TWITTER_ACCOUNT_RATE_LIMIT_URL TWITTER_API_URL "/account/rate_limit_status.xml" |
---|
68 | |
---|
69 | /* Favorites URLs */ |
---|
70 | #define TWITTER_FAVORITES_GET_URL TWITTER_API_URL "/favorites.xml" |
---|
71 | #define TWITTER_FAVORITE_CREATE_URL TWITTER_API_URL "/favorites/create/" |
---|
72 | #define TWITTER_FAVORITE_DESTROY_URL TWITTER_API_URL "/favorites/destroy/" |
---|
73 | |
---|
74 | /* Block URLs */ |
---|
75 | #define TWITTER_BLOCKS_CREATE_URL TWITTER_API_URL "/blocks/create/" |
---|
76 | #define TWITTER_BLOCKS_DESTROY_URL TWITTER_API_URL "/blocks/destroy/" |
---|
77 | |
---|
78 | void twitter_get_friends_ids(struct im_connection *ic, int next_cursor); |
---|
79 | void twitter_get_home_timeline(struct im_connection *ic, int next_cursor); |
---|
80 | |
---|
81 | void twitter_post_status(struct im_connection *ic, char* msg); |
---|
82 | |
---|
83 | #endif //_TWITTER_LIB_H |
---|
84 | |
---|