Last active
February 27, 2025 14:06
-
-
Save thematrixdev/af4c0a643ecf75e158a827ccfaf2f6de to your computer and use it in GitHub Desktop.
GNews for HA.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- sensor: | |
name: "News World" | |
scan_interval: 604800 | |
command: > | |
curl --silent "https://gnews.io/api/v4/top-headlines?category=world&lang=zh&country=hk&max=10&from=$(date +\"%Y-%m-%dT00:00:00Z\")&apikey=" | | |
jq '{articles: [.articles[] | {title: .title}]}' | |
value_template: "OK" | |
json_attributes: | |
- articles | |
- sensor: | |
name: "News Nation" | |
scan_interval: 604800 | |
command: > | |
curl --silent "https://gnews.io/api/v4/top-headlines?category=nation&lang=zh&country=hk&max=10&from=$(date +\"%Y-%m-%dT00:00:00Z\")&apikey=" | | |
jq '{articles: [.articles[] | {title: .title}]}' | |
value_template: "OK" | |
json_attributes: | |
- articles | |
- sensor: | |
name: "News Technology" | |
scan_interval: 604800 | |
command: > | |
curl --silent "https://gnews.io/api/v4/top-headlines?category=technology&lang=zh&country=hk&max=10&from=$(date +\"%Y-%m-%dT00:00:00Z\")&apikey=" | | |
jq '{articles: [.articles[] | {title: .title}]}' | |
value_template: "OK" | |
json_attributes: | |
- articles | |
- sensor: | |
name: "News Science" | |
scan_interval: 604800 | |
command: > | |
curl --silent "https://gnews.io/api/v4/top-headlines?category=science&lang=zh&country=hk&max=10&from=$(date +\"%Y-%m-%dT00:00:00Z\")&apikey=" | | |
jq '{articles: [.articles[] | {title: .title}]}' | |
value_template: "OK" | |
json_attributes: | |
- articles | |
- sensor: | |
name: "News Health" | |
scan_interval: 604800 | |
command: > | |
curl --silent "https://gnews.io/api/v4/top-headlines?category=health&lang=zh&country=hk&max=10&from=$(date +\"%Y-%m-%dT00:00:00Z\")&apikey=" | | |
jq '{articles: [.articles[] | {title: .title}]}' | |
value_template: "OK" | |
json_attributes: | |
- articles |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment