Last active
May 27, 2018 22:06
Star
You must be signed in to star a gist
PowerShellっぽく陸上自衛隊のイラク派遣日報をまとめてダウンロードしてみる (同期処理)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Invoke-WebRequest -Uri https://www.asahi.com/articles/ASL4J669JL4JUEHF016.html).Links.href | Where {$_.EndsWith(".pdf")} | Sort-Object -Unique -PipelineVariable pdf | ForEach{ Start-Job {param($uri,$file,$path) cd $path; Invoke-WebRequest -Uri $uri -OutFile $file} -ArgumentList $pdf,$pdf.Split("ichikijiatesi/").Replace("/","_")[1]),$pwd} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Invoke-WebRequest -Uri https://www.asahi.com/articles/ASL4J669JL4JUEHF016.html).Links.href | Where {$_.EndsWith(".pdf")} | Sort-Object -Unique | ForEach {Invoke-WebRequest -Uri $_ -OutFile ($_.Split("ichikijiatesi/").Replace("/","_"))[1]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment