/rapidsms-backend-twitter

Twitter backend to rapidsms

Primary LanguagePython

README
======

"""
RapidSMS backend to tweet messages

@author Sebastian Henschel <sebastian@transparency.ge>
@see http://transparency.ge
@license GPL v3

This backend depends on tweepy,
http://github.com/joshthecoder/tweepy .
Install it by

$ apt-get install python-tweepy

or

$ pip install tweepy 

It is also advisable to have south installed (http://south.aeracode.org/).


1) Put the directory 'backends/' into the root.


2) Unfortunately, the default identiy field is not long enough (only 100 chars)
for a complete OAuth credential string, so we have to extend RapidSMS'
connection class. Put the directory 'extensions/' into apps/<name>/ and run

$ python manage.py schemamigration rapidsms --auto

to create an appropriate migration, followed by

$ python manage.py migrate rapidsms

to migrate the database and add a field oauth to the Connection model.


3) Then you need to append 'twitter' to the list of available backends in
settings.py, like so:

INSTALLED_BACKENDS = {

 # other backends ...

 'twitter': {
  'ENGINE': 'backends.twitter', 
 }
}


4) Afterwards go to https://dev.twitter.com/apps to setup an 'application' and
get the required credentials.


5) Finally, you have to put these into the field 'oauth' when
editing the connection for your contact details in the format:

consumer_key:consumer_secret:access_token:access_secret

Add as many twitter contacts as you like!