Last active
May 4, 2017 03:38
-
-
Save mpoerwito/a2d9fadc31ca0d53a4e2a748be90330f to your computer and use it in GitHub Desktop.
get a list of links from a web page
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
Param($sitename) | |
$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path | |
Function GetTmblrLinks() | |
{ | |
Param([string]$siteName) | |
$url = "https://" + $siteName + ".tumblr.com/archive" | |
$page = Invoke-WebRequest -Uri $url | |
$page.Links | Where-Object {$_.href -like '*/post/*'} | | |
ForEach-Object {$_.href } | Out-File $ScriptDir"/data/"$siteName"_links.txt" | |
} | |
GetTmblrLinks($sitename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment