[Help] HTTP Get

Here is the task which checking for URL redirection. If %url is not redirected, it stays as it is. If it's redirected the response page header is searched for new URL (redirected URL). Note that in A7, in 'Search' field after Location:, after colon there is a space (not seen here).

A1: HTTP Get [ Server:Port:%url Path: Attributes: Cookies: User Agent: Timeout:10 Mime Type: Output File: Trust Any Certificate:Off ] <if image %url is redirected> A2: If [ %HTTPR ~ 302 ] A3: For [ Variable:%header Items:%header() ] A4: Variable Add [ Name:%item Value:1 Wrap Around:0 ] A5: Variable Set [ Name:%hraderwithlocationurl To:%item Recurse Variables:Off Do Maths:Off Append:Off ] If [ %header(%item) ~ Location ] A6: End For A7: Variable Search Replace [ Variable:%header(%hraderwithlocationurl) Search:Location: Ignore Case:Off Multi-Line:Off One Match Only:On Store Matches In: Replace Matches:On Replace With: ] A8: Variable Set [ Name:%url To:%header(%hraderwithlocationurl) Recurse Variables:Off Do Maths:Off Append:Off ] A9: End If

Regarding Astronomy Picture of the Day, try to change http to htpps. They changed to secure connection a few weeks ago.

/r/tasker Thread