aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/twitter/twitter_http.h
blob: d46ee4e51081fec18d9e00fd497b9d57f58de845 (plain)
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
/***************************************************************************\
*                                                                           *
*  BitlBee - An IRC to IM gateway                                           *
*  Simple module to facilitate twitter functionality.                       *
*                                                                           *
*  Copyright 2009 Geert Mulders <g.c.w.m.mulders@gmail.com>                 *
*                                                                           *
*  This library is free software; you can redistribute it and/or            *
*  modify it under the terms of the GNU Lesser General Public               *
*  License as published by the Free Software Foundation, version            *
*  2.1.                                                                     *
*                                                                           *
*  This library is distributed in the hope that it will be useful,          *
*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        *
*  Lesser General Public License for more details.                          *
*                                                                           *
*  You should have received a copy of the GNU Lesser General Public License *
*  along with this library; if not, write to the Free Software Foundation,  *
*  Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA           *
*                                                                           *
****************************************************************************/

#ifndef _TWITTER_HTTP_H
#define _TWITTER_HTTP_H

#include "nogaim.h"
#include "http_client.h"

typedef enum {
	/* With this set, twitter_http_post() will post a generic confirmation
	   message to the user. */
	TWITTER_HTTP_USER_ACK = 0x1000000,
} twitter_http_flags_t;

struct oauth_info;

struct http_request *twitter_http(struct im_connection *ic, char *url_string, http_input_function func,
                                  gpointer data, int is_post, char** arguments, int arguments_len);
struct http_request *twitter_http_f(struct im_connection *ic, char *url_string, http_input_function func,
                                    gpointer data, int is_post, char** arguments, int arguments_len,
                                    twitter_http_flags_t flags);

#endif //_TWITTER_HTTP_H
ux inetds are like this. They don't allow you to specify a port number in the inetd.conf entry, instead you have to put a service name there (one that is also mentioned in /etc/services). So if there's no line in /services for 6667/tcp (or whatever you choose), add it and use that name in the inetd.conf entry. -- xinetd installation (equally deprecated) Most machines use xinetd instead of inetd these days. If your machine runs xinetd, you can copy the bitlbee.xinetd file from the doc/ directory to your xinetd.d/ directory. Most likely you'll have to change a thing or two before it'll work. After configuring your (x)inetd, send the daemon a SIGHUP and things should work. If not, see your syslogs, since both daemons will complain there when something's wrong. Also, don't forget to create the configuration directory (/var/lib/bitlbee/ by default) and chown it to the UID BitlBee is running as. Make sure this directory is read-/writable by this user only. DEPENDENCIES ============ BitlBee's only real dependency is GLib. This is available on virtually every platform. Any recent version of GLib (2.4 or higher) will work. Off-the-Record encryption support can be included if libotr is available on your machine. Pass --otr=1 to configure to build it into BitlBee, or --otr=plugin to build it as a separate loadable plugin (mostly meant for distro packages). These days, many IM protocols use SSL/TLS connections (for authentication or for the whole session). BitlBee can use several SSL libraries for this: GnuTLS, NSS (which comes with Mozilla) and OpenSSL. OpenSSL is not GPL- compatible in some situations, so using GnuTLS is preferred. However, especially on *BSD, OpenSSL can be considered part of the operating system, which eliminates the GPL incompatibility. The incompatibility is also the reason why the SSL library detection code doesn't attempt to use OpenSSL. If you want to use OpenSSL, you have to force configure to use it using the --ssl=openssl parameter. For more information about this problem, see the URL's configure will write to stdout when you attempt to use OpenSSL. PORTABILITY ISSUES ================== Cygwin NOTE: You'll need a glib installation to run BitlBee. However, Cygwin doesn't provide a glib package. You can download a binary tar.gz from: <http://my.dreamwiz.com/jbdoll/>. When you installed it, BitlBee should work fine. You'll probably like bitlbeed or xinetd to get it running on the network. On some non-Linux systems the program still suffers from some random bugs. Please do report them, we might be able to fix them if they're not too mysterious. Also, the configure script is known to not work very well with non-Bash shells, so if you experience problems, make sure you use bash to run the script. Same for the Makefile, it only works well with GNU make. (gmake on most BSD systems) If someone can tell us how to write Makefiles that work with both/all versions of make, we'd love to hear it, but it seems this just isn't possible. USAGE ===== Not much to say here, it's all documented elsewhere already. Just connect to the new BitlBee IRC server and the bot (root) will tell you what to do. BACKGROUNDS =========== We are both console lovers. But it is annoying to have a few tty's open with chat things in them. IRC, ICQ, MSN, AIM, Jabber... For X there is Gaim, which supports many chatprotocols. Why wasn't there such a thing for the console? The idea to port Gaim was easily thought of, of course. But we liked our IRC clients. And we used it the most, so we used it best. Importing it into the IRC client was a nice idea. But what if someone liked a different client. Then (s)he had to duplicate our work. That's a shame, we thought. Doing work twice is pointless. So when Wilmer got the ingenious thought in his mind while farming, to create an IRC to other chatnetworks gateway, we were both so excited, that we started working on it almost immediately. And the result is BitlBee. WEBSITE ======= You can find new releases of BitlBee at: http://www.bitlbee.org/ The bug tracking system: http://bugs.bitlbee.org/ Our version control system is Bazaar. Our repository is at: http://code.bitlbee.org/ More documentation on the Wiki: http://wiki.bitlbee.org/ A NOTE ON PASSWORD ENCRYPTION ============================= There used to be a note here about the simple obfuscation method used to make the passwords in the configuration files unreadable. However, BitlBee now uses a better format (and real encryption (salted MD5 and RC4)) to store the passwords. This means that people who somehow get their hands on your configuration files can't easily extract your passwords from them anymore. However, once you log into the BitlBee server and send your password, an intruder with tcpdump can still read your passwords. This can't really be avoided, of course. The new format is a lot more reliable (because it can't be cracked with just very basic crypto analysis anymore), but you still have to be careful. The main extra protection offered by the new format is that the files can only be cracked with some help from the user (by sending the password at login time). So if you run a public server, it's most important that you don't give root access to people who like to play with tcpdump. Also, it's a good idea to delete all *.nicks/*.accounts files as soon as BitlBee converted them to the new format (which happens as soon as the user logs in, it can't be done automatically because it needs the password for that account). You won't need them anymore (unless you want to switch back to an older BitlBee version) and they only make it easier for others to crack your passwords. LEGAL ===== BitlBee is distributed under the GPL (GNU General Public License). See the file COPYING for this license. The MD5 algorithm code is licensed under the Aladdin license. This license can be found in the files, to which this applies. The SHA1 algorithm code is licensed under the Mozilla Public License, see http://www.mozilla.org/MPL/ for details. The Yahoo! library used by BitlBee is libyahoo2 <http://libyahoo2.sf.net/>, also licensed under the GPL. BitlBee - An IRC to other chat networks gateway <http://www.bitlbee.org/> Copyright (C) 2002-2010 Wilmer van der Gaast <wilmer@gaast.net> and others