Flexible drupal content-types
I am thinking you are wanting to learn more about blocks.  You could, for example, have a block that output an iframe/html/whatever widget.  In the blocks hooks, you can use all sorts of information to decide when to display it it, eg what page/url, what type of node, etc.  So, for example with twitter, you could grab information/fields from the node it is being displayed next to and customize it appropriately.