name: news-search description: Search and fetch news using various free APIs and sources.
News Search Skill
获取新闻的技能。
Free News Sources
- DuckDuckGo API - https://api.duckduckgo.com/
- NewsAPI - https://newsapi.org/ (needs key)
- GNews - https://gnews.io/ (needs key)
- RSS feeds - Various news sites
Simple Search Function
function Get-News {
param([string]$Query = "today's news")
try {
$response = Invoke-RestMethod -Uri "https://api.duckduckgo.com/?q=$([Uri]::EscapeDataString($Query))&format=json&no_html=1" -UseBasicParsing
return $response
} catch {
Write-Error "Failed to fetch news: $_"
}
}
Search for news.