{"id":2254,"date":"2018-03-07T22:03:13","date_gmt":"2018-03-07T20:03:13","guid":{"rendered":"http:\/\/soci.hu\/blog\/?p=2254"},"modified":"2018-03-07T22:06:27","modified_gmt":"2018-03-07T20:06:27","slug":"net-rocks-letoltese-kocsiban-hallagatashoz","status":"publish","type":"post","link":"https:\/\/soci.hu\/blog\/index.php\/2018\/03\/07\/net-rocks-letoltese-kocsiban-hallagatashoz\/","title":{"rendered":".NET Rocks let\u00f6lt\u00e9se kocsiban hallgat\u00e1shoz"},"content":{"rendered":"<p>M\u00e1sold be egy ps1 f\u00e1jlba, \u00e9s hagyd \u00fagy \u00e9jszak\u00e1ra, reggelre ott lesz az <a href=\"https:\/\/www.dotnetrocks.com\/\">eg\u00e9sz<\/a>.<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\nfunction GetFeedPageCount ($url) {\r\n  $feed=&#x5B;xml](New-Object System.Net.WebClient).DownloadString($url)\r\n  $pageCount = $feed.rss.channel.pageCount\r\n  return $pageCount;\r\n}\r\n\r\nfunction DownloadFeed ($url) {\r\n  $feed=&#x5B;xml](New-Object System.Net.WebClient).DownloadString($url)\r\n  foreach($i in $feed.rss.channel.item) {\r\n    $url = New-Object System.Uri($i.enclosure.url)\r\n    $url.ToString()\r\n    $url.Segments&#x5B;-1]\r\n    $localFile = $url.Segments&#x5B;-1]\r\n    if (Test-Path($localFile)) {\r\n      Write-Host &quot;Skipping file, already downloaded&quot;\r\n    }\r\n    else\r\n    {\r\n      Invoke-WebRequest $url -OutFile $url.Segments&#x5B;-1]\r\n    }\r\n  }\r\n}\r\n\r\n# Related blog post here: http:\/\/blogs.msdn.com\/b\/cdndevs\/archive\/2014\/11\/18\/azure-fridays-a-powershell-script-to-download-rss-videos.aspx\r\n\r\n$feedUrl = &quot;http:\/\/www.pwop.com\/feed.aspx?show=dotnetrocks&amp;filetype=master&quot;\r\nDownloadFeed($feedUrl)\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>M\u00e1sold be egy ps1 f\u00e1jlba, \u00e9s hagyd \u00fagy \u00e9jszak\u00e1ra, reggelre ott lesz az eg\u00e9sz. function GetFeedPageCount ($url) { $feed=&#x5B;xml](New-Object System.Net.WebClient).DownloadString($url) $pageCount =&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,4],"tags":[],"class_list":["post-2254","post","type-post","status-publish","format-standard","hentry","category-powershell","category-szakmai-elet"],"_links":{"self":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=2254"}],"version-history":[{"count":5,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2254\/revisions"}],"predecessor-version":[{"id":2259,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2254\/revisions\/2259"}],"wp:attachment":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=2254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=2254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=2254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}