Is there any method (function) in drupal which gets called after nodes being created. I am creating a custom module for Drupal 7. I wanted to post the node that gets created of type "Article" to facebook wall so that user doesn't have to manually create a wall post.

For that I need to get a method (function) in drupal which gets called as soon as the nodes gets created, where I can put my Facebook API codes.
You are looking for hook_node_insert() 

This is from API page:


  Respond to creation of a new node.
  
  This hook is invoked from node_save() after the database query that
  will insert the node into the node table is scheduled for execution,
  after the type-specific hook_insert() is invoked, and after
  field_attach_insert() is called.


function MyModule_node_insert($node) {

  if($node-&gt;type == 'article') {
    //your code here
    custom_func();
  }
}

function custom_func() {
  //your code goes here
}