Last active
May 27, 2018 22:06
-
-
Save guitarrapc/60851d0a301a79f89757a59ef02c9778 to your computer and use it in GitHub Desktop.
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