NavigationUser login |
hellyeah@mit.edu's blogSending SMS via Skype w/ only 6 lines of codeSubmitted by hellyeah@mit.edu on Tue, 03/17/2009 - 01:44.
Hey folks, [ note: for code examples, see the attached files. I just wasted an hour trying to force Drupal (this blogging software) to preserve whitespace so it doesn't destroy all python code posted. Can the admin for this blog change the whitespace settings so we can share python code here? ]
The Skype API under Linux has one complication: it will not run when invoked by other programs such as chron or mod_python. This is because it needs access to the XServer environment variables. My solution to this is to create a little Skype relay server that is invoked on the command line and runs perpetually. Other programs can send SMS messages by sending message data to the relay server via a UDP socket. The example below simply receives a message body (via UDP) and sends it (via the Skype API) to a hard-coded phone number list. SkypeRelayServer.py: Here is an example of a client script that uses SkypeRelayServer.py to send SMS messages. It's a python script in the mod_python environment that reads an SMS message string submitted from a Web form and sends the data to SkypeRelayServer.py to be broadcast via SMS.
Liberia’s Blackboard BloggerSubmitted by hellyeah@mit.edu on Tue, 03/17/2009 - 00:07.
Great article: http://www.afrigadget.com/2009/03/13/liberias-blackboard-blogger/ Alfred Sirleaf is an analog blogger. He take runs the “Daily News”, a news hut by the side of a major road in the middle of Monrovia. He started it a number of years ago, stating that he wanted to get news into the hands of those who couldn’t afford newspapers, in the language that they could understand. Alfred serves as a reminder to the rest of us, that simple is often better, just because it works. The lack of electricity never throws him off. The lack of funding means he’s creative in ways that he recruits people from around the city and country to report news to him. He uses his cell phone as the major point of connection between him and the 10,000 (he says) that read his blackboard daily. |