It would seem that
http://web.icq.com/whitepages/
allows you to check for users
plus that page has the following code
<form name="search_uin" action="/whitepages/about_me/1,,,00.html" method="POST">
<input type="HIDDEN" name="to" value="%U">
<tr>
<td colspan="3" class="TCC" width="1"><img src="/lib/image/0,,52,00.gif" width="1" height="1" border="0"></td></tr><tr><td width="148"><span class="smallText">
<b> ICQ#:</b><img src="/lib/image/0,,52,00.gif" width="1" height="15" border="0" vspace="2"><br> <input type="text" name="Uin" value="" size=13 maxlength=40 class="regText"><br>
<center><input type="image" src="/lib/image/0,,5734,00.gif" border="0" width="56" height="25"></center><img src="/lib/image/0,,52,00.gif" width="1" height="4" border="0" vspace="2">
</span>
</td>
</tr></form>
you could try using curl to post to "/whitepages/about_me/1,,,00.html"
add the post variable Uin and you should get a page indicating if the user is online or not. Parse the page to figure it out. I think you'll have to check the image that is returned (online, offline, etc) right next to the user name.
In my case the code returned is
<span class="pageTitle2">
<b> Hello my name is <font color="#FFCC33">Gerardo Tasistro</font>.</b>
</span>
</td>
<td class="TCC" align="right" height="16">
<img src="/lib/image/0,,5717,00.gif" width="79" height="21" border="0" vspace="1" hspace="1">
</td>
<td class="TCC" width="1"><img src="/lib/image/0,,52,00.gif" width="1" height="1" border="0"></td>
so it is either
="/lib/image/0,,5717,00.gif"
="/lib/image/0,,52,00.gif"
that changes of both. Try with different users in different states(that is logged in or not) and see what happens. BTW, the result I show here is for Offline.
Saludos
Gerardo