What does the votingapi_set_votes function in the votingapi module actually do?
Here is a working example:

function YourModule_menu(){
  $items = array();
  $items['the/menu/path/1'] = array
    (
    'title' =&gt; 'Voting button',
    'page callback' =&gt; '_YourModule_voting',
    'access callback' =&gt; TRUE
    'type' =&gt; MENU_CALLBACK,

    );
  return $items;
}

function _YourModule_voting(){
  $nid=arg(3);
  $votes = array(
    'entity_type' =&gt; 'node',
    'entity_id' =&gt; $nid,
    'value_type' =&gt; "points",
    'value' =&gt; 1,
    'tag' =&gt; "like",
    );

  $criteria = NULL;

  if (module_exists('votingapi')) {
      votingapi_set_votes($votes);
  }     

  return "true";
}