AutoWeb APOD Wallpaper 1.2

Get Astronomy Picture of the Day wallpaper with API

  1. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Very cool! :)
     
  3. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
  4. R4V3N_2010

    R4V3N_2010 New Member

    Joined:
    Jun 22, 2016
    Messages:
    21
    Likes Received:
    3
    I like this Tasker project. But I can't get it to save the picture directly to my DCIM folder instead to my SD card. Is there a way to do this?
     
  5. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    In the first action of APOD Wallpaper task:
    A1: Variable Set [ Name:%APODDIR To:/storage/emulated/0/apod.jpg Do Maths:Off Append:Off ]
    change directory to:
    Name:%APODDIR To:/path_to_your_folder/apod.jpg
    for DCIM folder:
    Name:%APODDIR To:/storage/emulated/0/DCIM/apod.jpg

    Note that apod.jpg is every day overwritten by new image. That's why in the notofication is the button to save it with pick file action if you want to save it in different directory.

    Tip: If you want to save the picture every day automatically, change in above task the file name from apod.jpg to apod_%DATE.jpg.
     
    Last edited: Oct 9, 2016
  6. Hitchcock green

    Hitchcock green New Member

    Joined:
    Oct 8, 2016
    Messages:
    2
    Likes Received:
    0
    When I tried that it just overwrote the file with _%DATE in the name. :p
     
  7. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    You have to wait when the date is changed.:p Check folder where the files are saved tomorrow or in a few days. :D
     
    Last edited: Nov 8, 2016
  8. Hitchcock green

    Hitchcock green New Member

    Joined:
    Oct 8, 2016
    Messages:
    2
    Likes Received:
    0
    It only runs once a day....
    So it downloads a wallpaper and applies it. Then the next day it does it again but overwrites the first.
    It is LITERALLY naming the file apod_%DATE.jpg
     
  9. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    OK. I have this setup already in my task and it's working perfect. I can't belive that bulit in Tasker variable (%DATE) is not returned on your device. Could be that you mistyped % with ℅... Check it out please. Mistyping is the only reason I can see here. Otherwise I can't help you.
     
  10. R4V3N_2010

    R4V3N_2010 New Member

    Joined:
    Jun 22, 2016
    Messages:
    21
    Likes Received:
    3
    @szmerek is your task working? I downloaded your task a long time ago and it was working very well. But since 3 days it doesn't set the wallpaper. No matter what I try. Can you eventually help me?

    Sent from my ONEPLUS A3003 using Tapatalk
     
  11. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
  12. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    @R4V3N_2010 I noticed it as well. It seems that NASA started redirecting the API images URL (http) to the secure connection URL (https), without changeing URLs in the API. Tasker HTTP Get action can not handle it.
    In fact the only difference between the API URL and redirected URL is "s" on the http end, the rest of URL is the same. You can search-replace "http" with "https" but this is not the way it should be done.

    I've already updated the project with the following. Image URL received from API is validated against URL redirection. If API image URL is redirected - the response page header is searched for new (location) image URL. If it's not redirected %url stays like it was before, as URL received from the API output.
     
    Last edited: Dec 26, 2016
    R4V3N_2010 likes this.
  13. R4V3N_2010

    R4V3N_2010 New Member

    Joined:
    Jun 22, 2016
    Messages:
    21
    Likes Received:
    3
    Thanks for the update. I treid now a couple of days to get it to work again with no luck. I knew that the URL has changed. But unfortunately I am not a genius in tasker. I've to learn much.
     
  14. R4V3N_2010

    R4V3N_2010 New Member

    Joined:
    Jun 22, 2016
    Messages:
    21
    Likes Received:
    3
    That's me again. I treid now to set yesterday's image as lockscreen wallpaper. Guess what without any luck. Would you be so kind and add this to your awesome project? I know that this only work on Android 7. But if you don't wana add this can you be so kind and tell me how to do?
     
  15. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    @R4V3N_2010 I'm not going to update the project with yesterday's image as lockscreen wallpaper. There is already the project with this feature.
    Please find below what to do. After the last action of APOD Wallpaper task add this:

    A29: Variable Set [ Name:%apoddiryesterday To:/storage/emulated/0/apodyesterday.jpg Recurse Variables:Off Do Maths:Off Append:Off ]
    A30: AutoTools Time [ Configuration:
    ---------Add Time---------
    Use Now: true
    Add Unit: Days
    Add Value: -1
    Output Format: yyyy-MM-dd Timeout (Seconds):30 ]
    A31: Copy here action A2. In API configuration > Autput > Fileds to Get: leave only Url and Hdurl, the rest thick off. In Output > Date of the Image to Retrieve set %atcalculateddate
    A32 to A42 - Copy actions A7 to A17
    A43: HTTP Get [ Serverp:port:%url Path: Attributes: Cookies: User Agent: Timeout:60 Mime Type:image/* Output File:%apoddiryesterday Trust Any Certificate:Off ]
    A44: Set Wallpaper [ Type:Lockscreen Image:%apoddiryesterday Scale:On Crop:On ]
    A45: End If

    Hope this will work for you :)
     
    Last edited: Jan 3, 2017
  16. R4V3N_2010

    R4V3N_2010 New Member

    Joined:
    Jun 22, 2016
    Messages:
    21
    Likes Received:
    3
    Thanks it works but I get today's image as lockscreen wallpaper. Maybe I did something wrong. But I checked it a couple times and it seems that I did it like you told me. Do you have any suggestions?

    Sent from my ONEPLUS A3003 using Tapatalk
     
  17. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    Check:
    A44: Set Wallpaper [ Type:Lockscreen Image:%apoddiryesterday Scale:On Crop:On ]
    if you have here type lockscreen instead of launcher.
     
  18. R4V3N_2010

    R4V3N_2010 New Member

    Joined:
    Jun 22, 2016
    Messages:
    21
    Likes Received:
    3
    I did this as you told me.
    [​IMG]

    Sent from my ONEPLUS A3003 using Tapatalk
     
  19. autormali

    autormali Member

    Joined:
    Jul 4, 2016
    Messages:
    134
    Likes Received:
    22
    Could you export and post here task description (not xml) from action 29 to 45?
     
  20. R4V3N_2010

    R4V3N_2010 New Member

    Joined:
    Jun 22, 2016
    Messages:
    21
    Likes Received:
    3
    Of course here it is.

    A29: Variable Set [ Name:%apoddiryesterday To:/storage/emulated/0/DCIM/APOD1/apodyesterday.jpg Recurse Variables:Off Do Maths:Off Append:Off ]
    A30: AutoWeb Web Service [ Configuration:API: NASA Open APIs
    API Action: Astronomy Picture of the Day (APOD)
    HD Image: true Timeout (Seconds):120 ]
    A31: AutoTools Time [ Configuration:
    ---------Add Time---------
    Use Now: true
    Add Unit: Days
    Add Value: -1
    Output Format: yyyy-MM-dd Timeout (Seconds):30 ]
    A32: If [ %media_type ~ image ]
    <if hd picture output is set in api>
    A33: Variable Set [ Name:%url To:%hdurl Recurse Variables:Off Do Maths:Off Append:Off ] If [ %hdurl Set ]
    <check if image %url is redirected>
    A34: HTTP Get [ Server:port:%url Path: Attributes: Cookies: User Agent: Timeout:30 Mime Type: Output File: Trust Any Certificate:Off ]
    <if image %url is redirected>
    A35: If [ %HTTPR ~ 302 ]
    A36: For [ Variable:%header Items:%header() ]
    A37: Variable Add [ Name:%item Value:1 Wrap Around:0 ]
    A38: Variable Set [ Name:%hraderwithlocationurl To:%item Recurse Variables:Off Do Maths:Off Append:Off ] If [ %header(%item) ~ *Location* ]
    A39: End For
    A40: Variable Search Replace [ Variable:%header(%hraderwithlocationurl) Search:Location: Ignore Case:Off Multi-Line:Off One Match Only:On Store Matches In:%url Replace Matches:On Replace With: ]
    A41: Variable Set [ Name:%url To:%header(%hraderwithlocationurl) Recurse Variables:Off Do Maths:Off Append:Off ]
    A42: End If
    A43: HTTP Get [ Server:port:%url Path: Attributes: Cookies: User Agent: Timeout:60 Mime Type:image/* Output File:%apoddiryesterday Trust Any Certificate:Off ]
    A44: Set Wallpaper [ Type:Lockscreen Image:%apoddiryesterday Scale:On Crop:On ]
    A45: End If



    Sent from my ONEPLUS A3003 using Tapatalk
     

Share This Page