Skip to content

Instantly share code, notes, and snippets.

@roman-yagodin
Created September 28, 2021 11:56
Show Gist options
  • Save roman-yagodin/40e0cd868497ff283bd7b7c4c7ad22db to your computer and use it in GitHub Desktop.
Save roman-yagodin/40e0cd868497ff283bd7b7c4c7ad22db to your computer and use it in GitHub Desktop.
Download entire DCSS morgue directory from underhound.eu for player
#!/usr/bin/pwsh
$userName = "usernName"
$baseUri = "https://underhound.eu/crawl/morgue/"
New-Item -Path "$userName" -ItemType Directory
Invoke-WebRequest -Uri "$baseUri/$userName" -OutFile "./$userName/$userName.html"
foreach ($line in Get-Content "./$userName/$userName.html") {
if ($line -match '<a href=\"(morgue-[^\"]+)\"') {
$fileName = $Matches[1]
Write-Output $fileName
Invoke-WebRequest -Uri "$baseUri/$userName/$fileName" -OutFile "./$userName/$fileName"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment