Create short link automatically with ShURLy I am using the ShURLy module to create short links for nodes. I would like to be able to create the short links when nodes are published, automatically, without having to do the extra steps of clicking on the Bookmarklet which opens a new page where I create the short link by clicking on a button/link.

How can I achieve this?

update     

I am using workbench so I added   

function my_node_workbench_moderation_transition($node, 
$previous_state, $new_state) {
// Generate the short link when it is published.
  if ($new_state == 'published' &amp;&amp; $previous_state != $new_state) {
    $link = my_node_create_short_link($node-&gt;nid); 
  }
}    


and the function my_node_create_short_link with shorten (shorten_url)    

function my_node_create_short_link($node_id) {
 // Do not create the short link if already exists.
  $link = my_node_short_link_get($node_id);
  if ($link) {
      return $link;
  }
  else {
    $link = shorten_url(url('node/' . $node-&gt;nid, array('absolute' =&gt; TRUE)));
    // Insert the link
    my_node_short_link_insert($node-&gt;nid;, $link);
    cache_set($node-&gt;nid;, $link);
    return $link;
  }


}
As per the current module functionalities it does not seem to have that feature. So I think you need to create custom module.

In your custom module you will require to use hook_node_insert (For Drupal 7) this hook to execute after each node is added. Then Shurly provides API to create short link, using those APIs you can create short link as an when required.

Hope this helps.. :)