Introducing Chagol!

Having learnt how easy it was to develop ruby gems, I thought of putting my newly learned skills to the test and the result is chagol. Any work of software starts by scratching a developer’s personal itch and chagol does that for me. Before I tell you how to get hold of chagol, let me tell you why I’ve started developing it. As a student most of my communication is through text messages and quite often when I’m working on something I get a message that I have to respond to. I typically reply back using the phone or use a service like way2sms to do the same both of these take more time than that ought be taken. I’m a command line junkie so a command line tool with a simple interface would be ideal for me and since none existed I thought I’d write one myself.The goals that I had in mind before starting out were to adhere to the unix philosophy and hence chagol does one task only and I’d like to think it does that very well. The interface had to be simple to use and intuitive, no one likes command like tools that make you learn a tonne of syntax, this initially sounded hard to me but ruby’s OptionParser made this almost trivial. If you wish to use chagol, you should look at the readme in the github repository. The only prerequisites are having a flavor of ruby > 1.9 on your machine along with an account with way2sms or 160by2.

I’ll briefly write about configuring it after installation, there is one file that is mandatory, it should contain your way2sms/160by2 username i.e. your mobile no. and the password for the same. To edit it, you need to run

 vim ~/.chagol/config.rb 

vim can be replaced with the editor of your choice. After this is done you should be able to send messages with it, the usage is

 chagol -t 9876543210 -m "Your message" 

but remembering numbers is something that I find nearly impossible and so we need contacts too so that you could send messages like

 chagol -t Nikhil,Pinnu -m "Chagol rocks!" 

yes you guessed it, you can send messages to multiple people at the same time too but you need to specify your contacts once before chagol can use them, to do this you need to edit this file

 vim ~/.chagol/contacts.json 

Add as many contacts as you want to, you can use the one dummy contact that you’ll find there to use as a template for the others, please keep the id’s unique. I’m thinking of implementing lists using those if enough people using chagol ask for it.

Another thing that you need to know is that chagol isn’t only a command line tool, it can easily be used with any existing ruby project (See the Readme on github if you want to use it from your website to send messages) to send messages to mobile phones in India also it can’t send international messages either.

Perhaps another feature can be the ability to easily add contacts, since I’m the one implementing chagol that can be done too, do leave a comment if you used chagol to let me know how you found it and also if there are some features that you’d like implemented or bugs that need fixed.


P.S : The story behind the name is best left untold for now 😉

2 thoughts on “Introducing Chagol!”

  1. Hi Nikhil,
    Awesome work .

    Since am new to rails,
    I dont know where to embed this code

    require ‘chagol’
    texter = Chagol::SmsSender(“9876543210″,”password”,”way2sms”)
    texter.send(“9968154700”, “Chagol Rocks”)

    in my existing rails app.

    i.e., whether I have to paste this in my controller..?

    Looking forward for your reply.

    1. Hi Yotesh,
      It was a mistake on my part, please change the line
      texter = Chagol::SmsSender(“9876543210″,”password”,”way2sms”)
      texter =“9876543210″,”password”,”way2sms”)

      Hopefully this resolves your issue. I will fix the documentation to reflect this change.
      Feel free to ask for any clarifications with chagol.

Comments are closed.