aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/App.java
blob: 8e1090f1df34739c1910195d765084522b9027bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import com.pina.Holodex;
import com.pina.HolodexException;
import com.pina.LiveStream;
import com.pina.query.LiveStreamsQueryBuilder;

import java.util.List;

public class App
{
    public static void main( String[] args )
    {
        Holodex holodex = new Holodex();
        try {
            LiveStreamsQueryBuilder query = new LiveStreamsQueryBuilder();
            query.setChannelId("UCBQd84IW8OvM8H5jftHdvmw");
            query.setStatus("live");
            List<LiveStream> liveStreams = holodex.getLiveStreams(query);
            for (LiveStream stream : liveStreams) {
                System.out.println(stream.title + " is live with " + stream.live_viewers + " viewers" + stream.id);
            }
        } catch (HolodexException e) {
            System.err.println("Failed to get live streams: " + e.getMessage());
        }
    }
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage