Thread:Talk:Echo (Notifications)/Is there a callback?

I want to query Echo from a gadget to see if there is a pending notification. I first tried by using .hasClass('mw-badge-important'), but that is not reliable as the class is added after my gadget has run. Is there a callback I can call, or am I forced to use the API? Also, what does the "web interface" entail?