From cd94ea0973a171811918f2922993d516a5a914cd Mon Sep 17 00:00:00 2001 From: Kim Date: Wed, 2 Dec 2020 11:29:29 +0100 Subject: [PATCH] added usage example --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 791f0ba..83628dc 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,27 @@ However the script needs the channel id. You can get the id from here when you o Requires '_requests_' to work. + +## Usage example +````python +from GetLatestVideo import API + +# Add your Youtube Data API V3 Key here +API_KEY = '' + +# Add the Channel IDs here +# When you only know the channel name you can get the ID from here https://commentpicker.com/youtube-channel-id.php +CHANNEL_ID = [ + 'ID1', + 'ID2' +] + +videos = [] + +yt = API(API_KEY) + +for channel in CHANNEL_ID: + videos.append(yt.get_latest_video(channel)) + +print(videos) +```` \ No newline at end of file