uhhh websites to visit
# Define the URLs for the security news websites
$csoUrl = "https://www.csoonline.com"
$krebsUrl = "https://krebsonsecurity.com"
$darkReadingUrl = "https://www.darkreading.com"
# Function to fetch and display headlines from a URL
function Get-NewsHeadlines {
param (
[string]$url
)
try {
# Fetch content from the URL
$response = Invoke-WebRequest -Uri $url -UseBasicParsing
# Parse and extract headlines - Adjust selectors as needed for each site
$headlines = $response.Content | Select-String -Pattern "<title>(.*?)</title>" -AllMatches | ForEach-Object { $_.Matches.Groups[1].Value }
# Display the headlines
$headlines | Select-Object -First 5 # Adjust the number to control how many headlines are displayed
}
catch {
Write-Host "Error fetching news from $url. Please check the URL or network connectivity."
}
}
# Fetch and display news from each website
Write-Host "CSO Online Latest Headlines:"
Get-NewsHeadlines -url $csoUrl
Write-Host "`nKrebs on Security Latest Headlines:"
Get-NewsHeadlines -url $krebsUrl
Write-Host "`nDark Reading Latest Headlines:"
Get-NewsHeadlines -url $darkReadingUrl