Last active
November 8, 2022 10:28
-
-
Save Didgeridrew/a3481d621432ffd48aa9e6cea0bad87c to your computer and use it in GitHub Desktop.
HA: Spanish Word of the Day from RSS feed
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
| ##################################################################### | |
| # This sensor relies on the feedparser custom component: | |
| # https://github.com/custom-components/feedparser | |
| ##################################################################### | |
| sensor: | |
| - platform: feedparser | |
| name: Free Dictionary Spanish WOD | |
| feed_url: "https://es.thefreedictionary.com/_/WoD/rss.aspx?type=es_wod" | |
| scan_interval: | |
| hours: 12 | |
| inclusions: | |
| - title | |
| - link | |
| - summary | |
| exclusions: | |
| - title_detail | |
| - id | |
| - links | |
| - guidislink | |
| - summary_detail | |
| show_topn: 1 | |
| template: | |
| - sensor: | |
| - name: "Palabra del Dia" | |
| state: > | |
| {% set obj = state_attr('sensor.free_dictionary_spanish_wod', 'entries')[0] %} | |
| {{ obj.title }} | |
| attributes: | |
| definition: > | |
| {% set obj = state_attr('sensor.free_dictionary_spanish_wod', 'entries')[0] %} | |
| {{ (((obj.summary).rsplit('<br />')[0]) | |
| .replace('Definición: ', '')).rsplit(') ')[1] | |
| .replace('í', 'í') | |
| .replace('á', 'á') | |
| .replace('ó', 'ó') | |
| .replace('é', 'é') | |
| .replace('ú', 'ú') | |
| .replace('ñ', 'ñ') | |
| }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment