@obycode has made an app for rules:
It is probably very possible and he would have a good idea of how to get it done.