Headline News Reporter in PowerShell

Daft one today. Been a little  busy and lacking ideas as to what to do next, so don’t expect anything special in this post. That that you ever should with me…

Basically what this does is that it looks at the technology page the BBC news site and gives me the current 10 stories. Stupid right? I know, I know.

I might add this to a start-up script so that I can automatically get the latest tech news when ever I logon to my computer. Anyway, my code is below if you want to waste some hard drive space…

$result = Invoke-WebRequest -Uri http://www.bbc.co.uk/news/technology
$path = "C:\Scripts\testing.txt"
$result.Links | Select innertext | Select-String "full article *" | Out-File -FilePath $path

(Get-Content "$path") -replace "@{innerText=Full article" -replace "}","" | select -First 11


Leave a Reply