It looks like this opens a copy of WhatsApp Web and instruments it as its client. And it uses compiled class names like `._2EZ_m` to interact with the DOM. Unless I'm missing something, this will probably break weekly or every time they release a new build of the frontend. Not sure if there's a better way?
One alternative is sandboxing the js code (or using existing browser or networking logging capabilities) to reverse engineer network requests and write a more raw client instead of piggybacking onto the web client, that would still have risks of changes but less likely than this.
People already have done that. The most famous example is the yowsup [1] python library. The problem with these client implementations is that WhatsApp is banning any numbers that use them [2]. So most recent attempts to use WhatsApp outside of the official clients revolve around using WhatsApp Web somehow. That appears to work better, but even here if you are using it on a long term basis, WhatsApp might ban you.
Ultimately, WhatsApp is a bad host when it comes to using their service outside of the official app. This is really sad for people like me who don't want to install WhatsApp on their phones because it sends too much of my data to Facebook... probably that's precisely why they are so strict, to get all the data because that's all they get (the service is gratis after all). That and spam.
[1]: https://github.com/tgalal/yowsup [2]: http://google.com/search?q=yowsup+name+ban