I want to know if its possible to know if a guy is currently watching a stream on Twitch.
For exemple in the API you have a boolean true or false, if its true the person XXX is watching a streaming if its false the person XXX is offline.
If so, you could poll the view count of the x most watched streams (x being large enough to cover a significant portion, yet small enough to be feasible to retrieve) at set intervals. Assume that 2000 views recorded at a one hour interval, for example, equals to 2000 hours of collective view time. Use smaller intervals for greater accuracy.
Edit:
Use @Fugiman 's suggestion instead to get the number of total viewers. Given an interval in minutes, the collective hours are simply calculated by viewers / interval * 60.