Attempting to see if user is streaming! - 401 Error

So how would I do that? There are no code examples in the post you linked. (Unless im blind or something.)