Set Muzei Wallpapers from Subreddit feed

Learn how to read a subreddit, get all the image links and set them as wallpapers with Muzei

  1. joaomgcd
    By following this example you'll be able to get any subreddit's front page image links and use them as wallpapers with Muzei.

    In this example we're going to be getting wallpapers from

    Go directly to the last step to see how it looks in the end.


    /!\You need to add /.json at the end of a reddit URL so that the data returned is in the JSON format and not a normal HTML page.

    (i) Simple mode is used when reading Json objects in a very easy but more limited way.

    In this example we want to read the urls, titles and comment links from the reddit feed.

    This is a very simple version of the reddit feed to illustrate the example:
    Code (Text):

        "data": {
            "children": [
                    "kind": "t3",
                    "data": {
                        "permalink": "/r/ImaginaryCastles/comments/51a8kr/messenger_of_iron_islands_by_uros_sljivic/",
                        "url": "",
                        "title": "Messenger Of Iron Islands by Uros Sljivic",
                        "preview": {
                            "images": [
                                    "source": {
                                        "url": ""
    With Simple Mode we could simply set the fields to url,title,permalink and it would get the values. But since there are other fields in the reddit feed with that are named url (in the example above you can see that there is an images array with a source.url field in it) it would not work correctly because AutoTools would also get those fields and it would break the results.

    So, because of that, you have to use the "Non-Simple" version to read fields with their full path as seen below so that you get exactly the fields you want.


    • In the Fields field write,,
    (i) Each field path has the () suffix so that the fields are returned as arrays. If the prefix hadn't been used, only the first value for each field would be returned.
    Check the Json example above and check out how the path of the field names specified here corresponds to the path in the Json structure.


    • Tap Filter at the bottom
    • Set the Filter Fields to
    (i) This will make AutoTools filter results based on the url field
    • Set the Filter Value field to (\.jpg)|(\.png) and enable the Regex option
    (i) This is a regex that matches any text that has .jpg or .png in it. This will effectively filter out anything that isn't an image with the jpg or png extension
    • Go back to Tasker and add a Flash action
    • Write %data_children_data_url(#),%data_children_data_url(1),%data_children_data_title(1),%data_children_data_permalink(1)
    (i) This will make the flash show how many elements the Json Read action returned as well as the first url, title and permalink.
    Notice how the permalink starts with /r/ and not with We want to get working links so we need to prefix all links with to make them work correctly. We'll do that in the next step.


    • Add an AutoTools Text action
    • Set the Text field to %data_children_data_permalink()
    • Set the Variable Name field to data_children_data_permalink()
    (i) Notice how we used % in the Text field but not in the Variable Name field. That was because we want to use the contents of the %data_children_data_permalink() variable in the Text field, but we do NOT want to use the contents in the Variable Name field. We simply want to name the output variable with that name
    • Set the Prefix field to
    • Go back to Tasker and move the Flash action to the end of the task
    (i) As you can see the permalink value now has the right url prefix.


    • Add an AutoTools Muzei action
    /!\ The AutoTools Muzei options have moved into the AutoTools Image action, so add that action instead and use the Muzei subscreen there.
    • Set the Images field to %data_children_data_url()
    • Set the Titles field to %data_children_data_title()
    • Set the View URLs field to %data_children_data_permalink()
    • Enable the Next Image option
    (i) If you don't enable Next Image the wallpaper won't be set right away but will only change on the next scheduled change.
    • Set the Schedule field to 3600
    (i) This will make the wallpaper change each 3600 seconds, which is an hour

    STEP 6 - TEST

    • Run the Task
    • Go back to your home screen and notice how the wallpaper changes
    • Open Muzei and change the wallpaper by tapping the forward arrow button
    • Tap on the wallpaper title to go to the reddit comments page for the wallpaper

    That's it! You can now run task once a day for example, and it'll get the latest wallpapers and set them as your Muzei wallpapers. :cool:

    The task will get the image URLs, set them in Muzei (it will not download the files, but will use the URLs in Muzei directly. Muzei downloads the files when it needs them), and schedule automatic updates every hour. You only need to run the Task once when you want to get new images but the images will self-update in Muzei every hour automatically without any Tasker intervention.