Skip to content

Instantly share code, notes, and snippets.

@raicerk
Created July 6, 2019 23:20
Show Gist options
  • Save raicerk/fd8ca7d988126b5bce7bb7a038954765 to your computer and use it in GitHub Desktop.
Save raicerk/fd8ca7d988126b5bce7bb7a038954765 to your computer and use it in GitHub Desktop.
Comandos para power Shell para descargar los titulos de una pagina web de gif para informaticos
Function Get-Title {
param([string] $url)
$wc = New-Object System.Net.WebClient
$data = $wc.downloadstring($url)
$title = [regex] '(?<=<title>)([\S\s]*?)(?=</title>)'
write-output $title.Match($data).value.trim()
}
For ($i=0; $i -le 1474; $i++) {
$resultado = Get-Title http://www.humordev.com/gif/$i/
$resultado+"| http://www.humordev.com/gif/$i/" >> archivo5.txt
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment