javascript widget

hey guys
i m trying to generate a widget like reddit/delicious/google adsense
widget

please give pointers on how to do it
thanks