From b9c4f1dcf1333c14e2d1b67561ec7a5f955baa6e Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Sun, 9 Aug 2026 20:04:39 +0100 Subject: Initial commit --- pick-random-song.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 pick-random-song.php (limited to 'pick-random-song.php') diff --git a/pick-random-song.php b/pick-random-song.php new file mode 100644 index 0000000..7ba6a1b --- /dev/null +++ b/pick-random-song.php @@ -0,0 +1,40 @@ +pickRandomSongFromPlaylist($env['playlistName']); + +$name = $song['name'] ?? ''; +$artists = implode(',', array_map(function (array $artist): string { + return $artist['name']; +}, $song['artists'] ?? [])); + +echo "The song picked is $name by $artists\n"; + +exit(0); -- cgit v1.2.3-13-gbd6f