SMS to Twitter
I’ve wrote this shell script that uses an SMS to post to Twitter. It is ment to be used as an Eventhander for SMS Server Tools, but it’s simple enough for stand alone usage with simple text files.
If used as an Eventhandler the arguments are “RECEIVED” and the path to the SMS file, add “eventhandler=/path/to/sms2twitter.sh” to your smsd.conf. Without SMS Server Tools you can also use a simple file for posting to twitter:
Create a file starting like this:
-
Phone: 0634567890
-
-
Your tweet in max. 140 characters
Then call this script with the path to your file:
-
sms2twitter.sh /path/to/file.txt
You will need to create a sqlite3 DB with this schema:
-
sqlite3 sms2twitter.db \
-
"CREATE TABLE account (phone, username, password, PRIMARY KEY(phone))"
For every Phone that you allow to post Tweets thru SMS you need to run:
-
sqlite3 sms2twitter.db \
-
"INSERT INTO account VALUES (‘phonenumber’, ‘username’, ‘password’)"