Add this tag in your website you can check whether your YM friend is online or not!

<img border=0 src="http://opi.yahoo.com/online?u=username&m=g&t=0">

replace the username with your friend ID,...