aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorPinapelz <donaldshan1@outlook.com>2023-04-06 11:08:29 -0700
committerPinapelz <donaldshan1@outlook.com>2023-04-06 11:08:29 -0700
commit070887400d5164ee623796240ad29da385a12a44 (patch)
tree4bb5c5003e269c95947fabff34de51fdd7a7508b /README.md
parentcaed3a3e490ea5fa98dfdd767b0fb26018e28348 (diff)
Refactored return objects, distinguished according to API
Video and Channels have been split into simple variations for cases when Holodex returns an object with less values
Diffstat (limited to 'README.md')
-rw-r--r--README.md14
1 files changed, 6 insertions, 8 deletions
diff --git a/README.md b/README.md
index 583d83a..b9ef647 100644
--- a/README.md
+++ b/README.md
@@ -11,12 +11,12 @@ Holodex holodex = new Holodex("YOUR_API_KEY");
Channel channel = holodex.getChannel("UC4WvIIAo89_AzGUh1AZ6Dkg");
System.out.println(channel.name + " is a member of " + channel.org + " and has " + channel.suborg + " as a suborg");
-LiveVideoQueryBuilder liveVideoQuery = new LiveVideoQueryBuilder().setStatus("live").setOrg("Hololive");
-List<Video> currentlyLiveVideos = holodex.getLiveVideos(liveVideoQuery);
+VideoQueryBuilder liveVideoQuery = new VideoQueryBuilder().setStatus("live").setOrg("Hololive");
+List<SimpleVideo> currentlyLiveVideos = holodex.getLiveAndUpcomingVideos(liveVideoQuery);
System.out.println("Currently there are " + currentlyLiveVideos.size() + " livestreams on going in Hololive");
-for (Video video : currentlyLiveVideos) {
- System.out.println(video.channel.name + " is currently live with " + video.live_viewers + " views");
+for (SimpleVideo video : currentlyLiveVideos) {
+System.out.println(video.channel.name + " is currently live with " + video.live_viewers + " views");
}
ChannelQueryBuilder channelQuery = new ChannelQueryBuilder();
@@ -24,11 +24,9 @@ channelQuery.setOrg("Nijisanji");
channelQuery.setLimit(75);
List<Channel> nijisanjiMembers = holodex.getChannels(channelQuery);
-VideoQueryBuilder vidoeQuery = new VideoQueryBuilder();
-vidoeQuery.setVideoId("9-O_IWM3184");
-Video anotherVideo = holodex.getVideo(new VideoQueryBuilder().setVideoId("9-O_IWM3184").setLang("en"));
+Video anotherVideo = holodex.getVideo(new VideoMetadataQueryBuilder().setVideoId("9-O_IWM3184").setLang("en"));
System.out.println(anotherVideo.channel.name + " uploaded a video titled " + anotherVideo.title +
- " on " + anotherVideo.published_at);
+" on " + anotherVideo.published_at);
```
## Download
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage