How to put links in a menu programmatically? I'm using Drupal 7, and modules such as Service links and Flag. 

I would like to put the links proposed by these modules (share or flag) in a menu (main menu or other). 

Anybody know the way to follow?
Your question is relatively vague, but to answer the title, here's the code you need to use:

$link = array(
  'link_title' =&gt; t('Your link'),
  'link_path' =&gt; 'your-path',
  // Enter the name of the menu where you want this link to appear.
  'menu_name' =&gt; 'main-menu',
  'weight' =&gt; 0,
);
menu_link_save($link);