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

Enjoy!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s