function get-random-quote() { $apiUrl = 'http://www.forismatic.com/api/1.0/' $client = new-object System.Net.WebClient $client.Headers.Add("Content-Type", "application/x-www-form-urlencoded") $client.Encoding = [System.Text.Encoding]::UTF8 [xml]$quote = $client.UploadString($apiUrl, 'method=getQuote&format=xml' ) $quote.forismatic.quote }
PS C:\Windows\system32> $quote = get-random-quote ______________________________________________________________________________________________________________________________________________________________________ PS C:\Windows\system32> $quote quoteText quoteAuthor senderName senderLink --------- ----------- ---------- ---------- — . ______________________________________________________________________________________________________________________________________________________________________ PS C:\Windows\system32> $quote.quoteAuthor
$client = new-object System.Net.WebClient $client.Encoding = [System.Text.Encoding]::UTF8 [xml]$habr = $client.DownloadString('http://habrahabr.ru/rss/9c1806bb61d9b6612943104ddbf830d9/') $habr.rss.channel.item
title : title
guid : guid
link : habrahabr.ru/blogs/lenta/92187
description : description
pubDate : Tue, 27 Apr 2010 15:44:41 GMT
author : Mithgol
category : { , , , ...}
title : title
guid : guid
link : habrahabr.ru/blogs/startup/92152
description : description
pubDate : Tue, 27 Apr 2010 15:23:21 GMT
author : AynurEntre
category : {, , -, ...}
....
$habr.rss.channel.item | where { $_.author -eq 'mithgol' } | select link, category
Source: https://habr.com/ru/post/92206/
All Articles