Skip to content

Instantly share code, notes, and snippets.

@jnaskali
Created April 9, 2021 05:06
Show Gist options
  • Save jnaskali/0da849a48559c1b24d1d7922cc93b4b0 to your computer and use it in GitHub Desktop.
Save jnaskali/0da849a48559c1b24d1d7922cc93b4b0 to your computer and use it in GitHub Desktop.
Tasker project: Get HQ Wallpaper from Subreddit(s)
<TaskerData sr="" dvi="1" tv="5.11.14">
<Task sr="task27">
<cdate>1617818040844</cdate>
<edate>1617944528998</edate>
<id>27</id>
<nme>Wallpaper from Reddit</nme>
<pri>100</pri>
<rty>1</rty>
<Action sr="act0" ve="7">
<code>888</code>
<label>Loop if consecutive run</label>
<Str sr="arg0" ve="3">%RedditBgLoop</Str>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="0"/>
</Action>
<Action sr="act1" ve="7">
<code>547</code>
<Str sr="arg0" ve="3">%loop</Str>
<Str sr="arg1" ve="3">%RedditBgLoop+1</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="1"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act10" ve="7">
<code>135</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="5"/>
<Str sr="arg2" ve="3">Loop until HQ resolution</Str>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%loop</lhs>
<op>7</op>
<rhs>0</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act11" ve="7">
<code>548</code>
<Str sr="arg0" ve="3">Wallpaper: %title1</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act12" ve="7">
<code>1906260443</code>
<se>false</se>
<Bundle sr="arg0">
<Vals sr="val">
<com.twofortyfouram.locale.intent.extra.BLURB>Wallpaper: %url1
Lock Screen Wallpaper: %url1</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.JSON_ENCODED_KEYS>parameters</net.dinglisch.android.tasker.JSON_ENCODED_KEYS>
<net.dinglisch.android.tasker.JSON_ENCODED_KEYS-type>java.lang.String</net.dinglisch.android.tasker.JSON_ENCODED_KEYS-type>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0&gt;%err
Error Code
Only available if you select &amp;lt;b&amp;gt;Continue Task After Error&amp;lt;/b&amp;gt; and the action ends in error&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1&gt;%errmsg
Error Message
Only available if you select &amp;lt;b&amp;gt;Continue Task After Error&amp;lt;/b&amp;gt; and the action ends in error&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1&gt;&lt;/StringArray&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>parameters plugininstanceid plugintypeid </net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>java.lang.String</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
<parameters>{"inputImageColors":{"shouldGetImageColors":false,"shouldGetImageDimensions":false},"inputMuzei":{},"inputWallpapersDirect":{"settingLockWallpaperFile":"%url1","settingWallpaperFile":"%url1"},"generatedValues":{}}</parameters>
<parameters-type>java.lang.String</parameters-type>
<plugininstanceid>2d64cdde-2d4a-494d-99ce-0998aa5f42c1</plugininstanceid>
<plugininstanceid-type>java.lang.String</plugininstanceid-type>
<plugintypeid>com.joaomgcd.autotools.intent.IntentMuzei</plugintypeid>
<plugintypeid-type>java.lang.String</plugintypeid-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.joaomgcd.autotools</Str>
<Str sr="arg2" ve="3">com.joaomgcd.autotools.activity.ActivityConfigMuzei</Str>
<Int sr="arg3" val="60"/>
</Action>
<Action sr="act13" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="10"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act14" ve="7">
<code>549</code>
<Str sr="arg0" ve="3">%RedditBgLoop</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act2" ve="7">
<code>1446874931</code>
<Bundle sr="arg0">
<Vals sr="val">
<Average>&lt;null&gt;</Average>
<Average-type>java.lang.String</Average-type>
<Field>data.children.data.url(),data.children.data.title(),data.children.data.preview.images.source.height()</Field>
<Field-type>java.lang.String</Field-type>
<FilterInvert>false</FilterInvert>
<FilterInvert-type>java.lang.Boolean</FilterInvert-type>
<GetParentValues>false</GetParentValues>
<GetParentValues-type>java.lang.Boolean</GetParentValues-type>
<InputFormat>&lt;null&gt;</InputFormat>
<InputFormat-type>java.lang.String</InputFormat-type>
<JoinOutputArray>&lt;null&gt;</JoinOutputArray>
<JoinOutputArray-type>java.lang.String</JoinOutputArray-type>
<Json>https://reddit.com/r/%subreddits/top.json?t=day</Json>
<Json-type>java.lang.String</Json-type>
<JsonRootVariable>&lt;null&gt;</JsonRootVariable>
<JsonRootVariable-type>java.lang.String</JsonRootVariable-type>
<MatchField>&lt;null&gt;</MatchField>
<MatchField-type>java.lang.String</MatchField-type>
<MatchValue>&lt;null&gt;</MatchValue>
<MatchValue-type>java.lang.String</MatchValue-type>
<MatchesCaseInsensitive>false</MatchesCaseInsensitive>
<MatchesCaseInsensitive-type>java.lang.Boolean</MatchesCaseInsensitive-type>
<MatchesContainsAll>false</MatchesContainsAll>
<MatchesContainsAll-type>java.lang.Boolean</MatchesContainsAll-type>
<MatchesExact>false</MatchesExact>
<MatchesExact-type>java.lang.Boolean</MatchesExact-type>
<MatchesRegex>false</MatchesRegex>
<MatchesRegex-type>java.lang.Boolean</MatchesRegex-type>
<Max>&lt;null&gt;</Max>
<Max-type>java.lang.String</Max-type>
<MaxResults>&lt;null&gt;</MaxResults>
<MaxResults-type>java.lang.String</MaxResults-type>
<Min>&lt;null&gt;</Min>
<Min-type>java.lang.String</Min-type>
<Query>&lt;null&gt;</Query>
<Query-type>java.lang.String</Query-type>
<Separator>,</Separator>
<Separator-type>java.lang.String</Separator-type>
<SimpleMode>false</SimpleMode>
<SimpleMode-type>java.lang.Boolean</SimpleMode-type>
<SortArrayInvert>false</SortArrayInvert>
<SortArrayInvert-type>java.lang.Boolean</SortArrayInvert-type>
<SortArrayKey>&lt;null&gt;</SortArrayKey>
<SortArrayKey-type>java.lang.String</SortArrayKey-type>
<SortArrayObjectKey>&lt;null&gt;</SortArrayObjectKey>
<SortArrayObjectKey-type>java.lang.String</SortArrayObjectKey-type>
<Sum>&lt;null&gt;</Sum>
<Sum-type>java.lang.String</Sum-type>
<VariableName>url(),title(),height()</VariableName>
<VariableName-type>java.lang.String</VariableName-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Json: https://reddit.com/r/%subreddits/top.json?t=day
Fields: data.children.data.url(),data.children.data.title(),data.children.data.preview.images.source.height()
Variable Name: url(),title(),height()
Separator: ,</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0&gt;%height()
Json Values
Values of the fields you got from the json text&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1&gt;%title()
Json Values
Values of the fields you got from the json text&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES2&gt;%url()
Json Values
Values of the fields you got from the json text&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES2&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES3&gt;%err
Error Code
Only available if you select &amp;lt;b&amp;gt;Continue Task After Error&amp;lt;/b&amp;gt; and the action ends in error&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES3&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES4&gt;%errmsg
Error Message
Only available if you select &amp;lt;b&amp;gt;Continue Task After Error&amp;lt;/b&amp;gt; and the action ends in error&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES4&gt;&lt;/StringArray&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>Json Field VariableName Separator plugininstanceid plugintypeid </net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>java.lang.String</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
<plugininstanceid>7601e910-b15a-4595-b26b-c90158d88a1f</plugininstanceid>
<plugininstanceid-type>java.lang.String</plugininstanceid-type>
<plugintypeid>com.joaomgcd.autotools.intent.IntentJson</plugintypeid>
<plugintypeid-type>java.lang.String</plugintypeid-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.joaomgcd.autotools</Str>
<Str sr="arg2" ve="3">com.joaomgcd.autotools.activity.ActivityConfigJson</Str>
<Int sr="arg3" val="60"/>
</Action>
<Action sr="act3" ve="7">
<code>37</code>
<label>Loop until HQ resolution</label>
<ConditionList sr="if">
<bool0>And</bool0>
<Condition sr="c0" ve="3">
<lhs>%height1</lhs>
<op>6</op>
<rhs>1200</rhs>
</Condition>
<Condition sr="c1" ve="3">
<lhs>%height1</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act4" ve="7">
<code>356</code>
<Str sr="arg0" ve="3">%url</Str>
<Int sr="arg1" val="1"/>
<Str sr="arg2" ve="3"/>
</Action>
<Action sr="act5" ve="7">
<code>356</code>
<Str sr="arg0" ve="3">%height</Str>
<Int sr="arg1" val="1"/>
<Str sr="arg2" ve="3"/>
</Action>
<Action sr="act6" ve="7">
<code>356</code>
<Str sr="arg0" ve="3">%title</Str>
<Int sr="arg1" val="1"/>
<Str sr="arg2" ve="3"/>
</Action>
<Action sr="act7" ve="7">
<code>135</code>
<Int sr="arg0" val="1"/>
<Int sr="arg1" val="4"/>
<Str sr="arg2" ve="3">Loop until HQ resolution</Str>
</Action>
<Action sr="act8" ve="7">
<code>38</code>
</Action>
<Action sr="act9" ve="7">
<code>890</code>
<Str sr="arg0" ve="3">%loop</Str>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="0"/>
</Action>
<ProfileVariable sr="pv0">
<pvci>true</pvci>
<pvd>subredddit names separated by plus, e.g. eartporn+spaceporn</pvd>
<pvdn>Subreddits</pvdn>
<pvid>27</pvid>
<pvit>t</pvit>
<pvn>%subreddits</pvn>
<pvt>t</pvt>
<pvv>eartporn+spaceporn</pvv>
</ProfileVariable>
</Task>
</TaskerData>
@jnaskali
Copy link
Author

jnaskali commented Apr 9, 2021

This task downloads best posts of the day from the given subreddits (%subreddits, delimited by + sign) and loops through until it finds a high-enough quality image (min. 1200px high), which it sets as home and lock screen wallpaper.

Consecutive runs within 10 seconds download the next wallpaper from the list (%RedditBgLoop counts task runs and is cleared in 10 secs). I have the task set to triple-clicking my launcher background, so I can quickly go through a few wallpapers until I find one I like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment