Skip to content

Commit

Permalink
add links to each output in youtube.cue example
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Worm <tony@hofstadter.io>
  • Loading branch information
verdverm committed Jan 22, 2022
1 parent 096cedc commit 3ba33f9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/pipeline/youtube.cue
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ playlists: {
path: "/playlists?channelId=\(channel)&part=\(_parts)&key=\(call._key)"
}
}
// print: { text: json.Indent(json.Marshal(call.resp), "", " ") + "\n" } @task(os.Stdout)
pls: [ for item in call.resp.items {
id: item.id
title: item.snippet.title
link: "https://youtube.com/platlist?list=\(item.id)"
}]
}

Expand All @@ -60,16 +62,19 @@ details: {
path: "\(_path)&key=\(details._key)"
}
}
// print: (_id): { text: json.Indent(json.Marshal(call["\(_id)"].resp), "", " ") + "\n" } @task(os.Stdout)
info: (_id): [ for item in details.call["\(_id)"].resp.items {
id: item.id
title: item.snippet.title
link: "https://youtu.be/\(item.snippet.resourceId.videoId)"
}]
}
}

final: {
data: {
username: info.call.resp.items[0].snippet.title
"channel": "https://youtube.com/channel/\(channel)"
for pl in playlists.pls {
(pl.title): pl & { videos: details.info["\(pl.id)"] }
}
Expand Down

0 comments on commit 3ba33f9

Please sign in to comment.