You can use the API to request followers of a channel. There is no official API for hosts, there might be an unsupported one, but I’m not sure what it is. Alternatively you can also connect to chat with your broadcaster account and listen for messages that tell you about hosts.
To use the Twitch API you need to make HTTPS requests and parse JSON.