Send Twitter, IM, Email, or SMS messages from Erlang
Are you writing the next killer application in Erlang? Are you finding it hard to send messages on different communication channels due to a lack of supported libraries? In this tutorial, we will show you how you can use erlang and messagepub to send messages on email, IM, Google Chat, Twitter, or SMS. You can even make phone calls from erlang in one line of code.
I’ve written a small gen_server node to interact with the messagepub API. In order to use this code, you will need to sign up for messagepub and obtain an API key.
Once you have your API Key, it’s almost too easy:
- Get the messagepub.erl file from the messagepub-erlang project on github.
- Start an erlang shell and compile the messagepub module: c(messagepub).
- Start the gen_server with your API Key: messagepub:start_link(“API KEY”).
- Send messages as you please:
messagepub:send("email","joe@example.com", "hello joe").
messagepub:send("twitter", "the_real_shaq", "hi shaq!").
messagepub:send("gchat", "example@gmail.com", "Hello friend").
messagepub:send("aim", "username", "Saying hi from erlang").
messagepub:send("sms", "1234567890", "Hi my SMS friend").
messagepub:send("phone", "1234567890", "Hello on the phone").
That’s it. Now go write that killer application!
3 comments so far
Leave a reply

Nice (in the example page on messagepub, erlang is the smallest one!).
Bad it isn’t sending this messages somehow more directly. Can MessagePub handle 10,000 email+sms+twitter+phone+jabber sends per hour easly?
Please send us an email at info [at] messagepub [dot] com and we can see how we can accomodate you for this kind of volume. Thanks,
Luc (Founder of messagepub)
Hi, your service is very nice and API really simple. What we found problematic is that we can’t send SMS in Europe (UK, Poland, Sweden) :/