There are a number of modules designed encourage and reward activity on a Drupal website. One that looks interesting is Simple Contest. What this does is give some kind of a reward to the winning user (or node) who meets the conditions met for the particular contest. For example, there may be a contest (which is defined by create a node of a contest-supporting content type) which runs for 3 weeks, and the winner is the user who created the most content, rated the most content, created the most comments, etc. Or the winner might be
Although I'd probably create fields through the UI and export using the Features module (because I'm lazy), if you feel like adding fields to an entity programmatically, you might find http://drupal.org/node/1228878 helpful. That page actually covers:
One of the most powerful contributed modules available in Drupal 7 (and Drupal 6) is Rules (http://drupal.org/project/rules). The following exports are rules I have created to send out email notifications after saving content to everyone who has indicated they want these notifications in a custom field added to the user account. If it works, you'll receive an email very shortly!
I recommend the use of Entity API for a number of reasons. One reason is the Entity metadata wrapper. Although I haven't actually used this, I can see its benefits, and plan to use it soon. The Drupal Commerce set of modules makes extensive use of this.
What is allows is chainable access to all the properties of an entity. For example, if you have a node, and wanted to find the node author's email address and change it, you could do this as follows:
With Drupal 7's support for Field API, even the die-hard opponents of old-style CCK will find themselves using fields, and (hopefully) entities. But...how do you run a query efficiently on a field which could have multiple values?
The answer lies in EntityFieldQuery. Here are some examples of how it can be used: