home-assistant-configuration/config/templates/twitter_great_content.yaml

31 lines
1.4 KiB
YAML
Executable File

>
{# Twitter Great Content #}
{%- macro getRandomPromo() -%}
{{- [
"Checkout one of my favorite Home Assistant Youtubers @ccostan at https://www.youtube.com/channel/UC301G8JJFzY0BZ_0lshpKpQ ",
"Looking for some great Home Assistant content? @BeardedTinker has you covered. Subscribe at https://www.youtube.com/c/BeardedTinker ",
"Want some cool Home Assistant project ideas? @EverySmartHome has something for you at https://www.youtube.com/c/EverythingSmartHome",
"What to keep up with whats going on in the Smart Home space, follow @TheSHCollective and The Smart Home Collective podcast at https://feeds.buzzsprout.com/1649824.rss ",
"Follow @SmartHomeMaker2 and check out his videos at https://www.youtube.com/channel/UCa-_T4_g4T_11YMlxn80LaQ for some awesome Smart Home tutorials. "
] | random -}}
{%- endmacro -%}
{%- macro getTags() -%}
#homeassistant #youcandoit #givingback
{%- endmacro -%}
{# a macro that removes all newline characters, empty spaces, and returns formatted text #}
{%- macro cleanup(data) -%}
{%- for item in data.split("\n") if item | trim != "" -%}
{{ item | trim }} {% endfor -%}
{%- endmacro -%}
{# a macro to call all macros :) #}
{%- macro mother_of_all_macros() -%}
{{ getRandomPromo() }}
{{ getTags() }}
{%- endmacro -%}
{# Call the macro #}
{{- cleanup(mother_of_all_macros()) -}}