Rating will consists of two parts, one is the interface in the HTML which will be controlled by JS and CSS, and the 2nd is the script that will take the input on the server side.

You may also use the outbrain.com rating widget.