251
Post New Requests Here / Re: IDEA - Create a text doc of an artists discography.
« Last post by 4wd on November 08, 2020, 06:53 AM »Code: PowerShell [Select]
- <#
- .\DiscoFile-MB3.ps1 <Uri>
- Given the URI from https://musicbrainz.org for an artist it will retrieve the
- discography.
- eg.
- .\DiscoFile-MB3.ps1 https://musicbrainz.org/artist/66c662b6-6e2f-4930-8610-912e24c63ed1
- Will result in a file called 'AC_DC-MB - Discography.txt' in the same directory as
- DiscoFile-MB3.ps1
- #>
- param (
- [string]$Uri
- )
- $web = (Invoke-WebRequest -Uri $Uri).RawContent
- $temp = $web -replace '[\s\S]+application\/ld\+json..([\s\S]+?)<\/script>[\s\S]*$', '$1'
- $json = $temp | ConvertFrom-Json
- $outFile = ($json.name + "-MB - Discography.txt").Split([IO.Path]::GetInvalidFileNameChars()) -join '_'
- if (Test-Path $outFile) {
- Remove-Item $outFile -Force
- }
- for ($i = 0; $i -lt $json.album.Count; $i++) {
- $temp = $json.album[$i].albumReleaseType
- if ($temp -match 'AlbumRelease') {
- $temp = $json.album[$i].albumProductionType
- if (($temp -match '(LiveAlbum)|(StudioAlbum)') -and !($temp -match '(CompilationAlbum)|(SoundtrackAlbum)')) {
- $albumUri = ($json.album[$i].'@id' + "?inc=releases&fmt=json") -replace '\.org\/', '.org/ws/2/'
- $album = (Invoke-WebRequest -Uri "$($albumUri)") | ConvertFrom-Json
- "$($album.releases[0].date.Substring(0,4)) - $($album.title)" | Out-File -FilePath $outFile -Append
- }
- }
- }
- Get-Content $outFile | Sort-Object | Set-Content $outFile
Code: Text [Select]
- 1975 - High Voltage
- 1975 - T.N.T.
- 1976 - Dirty Deeds Done Dirt Cheap
- 1976 - High Voltage
- 1977 - Let There Be Rock
- 1978 - If You Want Blood You???ve Got It
- 1978 - Live from the Atlantic Studios
- 1978 - Powerage
- 1979 - Highway to Hell
- 1980 - Back in Black
- 1981 - For Those About to Rock (We Salute You)
- 1983 - Flick of the Switch
- 1985 - Fly on the Wall
- 1988 - Blow Up Your Video
- 1990 - The Razors Edge
- 1992 - Live at Donington
- 1995 - Ballbreaker
- 1996 - No Bull: Live - Plaza De Toros, Madrid
- 1996 - Westwood One Superstars In Concert Series
- 2000 - Stiff Upper Lip
- 2001 - Stiff Upper Lip: Live
- 2007 - Plug Me In
- 2008 - Black Ice
- 2011 - Live at River Plate
- 2014 - Rock or Bust
- 2018 - Legendary FM Broadcasts - The Paradise Theatre, Boston MA 21st August 1978
- 2018 - Live At Paradise Theatre Boston 1978
- 2019 - Live at the Apocalypse
- 2020 - AC/DC FM Broadcast Boston 1978
- 2020 - Power Up

Recent Posts

