Skip to content

Instantly share code, notes, and snippets.

@jtuttas
Last active December 15, 2015 02:29
Show Gist options
  • Save jtuttas/5187167 to your computer and use it in GitHub Desktop.
Save jtuttas/5187167 to your computer and use it in GitHub Desktop.
wernoch
cls
$gebtag=Read-Host "Dein Geburtstag (in der Form 11.April.1968)"
$geb = $gebtag.Split(".")
$webClient = new-object System.Net.WebClient
#$proxy = new-object System.Net.WebProxy "10.20.30.55:3128"
#$cred = New-Object System.Net.NetworkCredential 'veranstaltung', 'qwertz'
#$proxy.Credentials = $cred #(Get-Credential).GetNetworkCredential()
#$proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
#$webclient.proxy=$proxy
$webClient.Headers.Add("user-agent", "Windows Powershell WebClient Header")
#$webClient.UseDefaultCredentials = $true
$url = 'http://api.wolframalpha.com/v2/query?appid=QLVUAK-TVH4R83V4U&input=notable%20people%20born%20on%20'+$geb[1]+'%20'+$geb[0]+'%20'+$geb[2]+'&format=plaintext'
[XML]$alles = $webClient.DownloadString($url)
## oder so
#[xml]$b = Invoke-WebRequest "http://api.wolframalpha.com/v2/query?appid=QLVUAK-TVH4R83V4U&input=notable%20people%20born%20on%20April%2011%201968&format=plaintext"
$name=$alles.queryresult.pod[1].subpod.InnerText
Write-Host ("Am "+$geb[0]+"."+$geb[1]+"."+$geb[2]+" wurde auch "+$name+" geboren")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment