Automatically Apply Badges to Group Members (in Hosted Version)

Is there a way to paste an example code that we can upload on our site?
Is user1 is added to groupX, award badgeX

Simple, nothing more to it