AutoTools Pass Tasker variable to JSON Read

Discussion in 'AutoApps' started by SonOfJorEl87, Mar 11, 2017.

  1. SonOfJorEl87

    SonOfJorEl87 New Member

    Joined:
    Mar 11, 2017
    Messages:
    7
    Likes Received:
    0
    I'm trying to set up a task that queries a weather api based on my current location. I have one task set up so far that just grabs my location and splits it into lat and long but when I try to get JSON read to accept:

    api.openweathermap.org/data/2.5/forecast?lat=%LOC1&lon=%LOC2&units=metric&APPID=#############

    It clearly sends %LOC1 and %\LOC2 just as is (the information is not found).
    So I tried using an HTTP get in Tasker and then putting %HTTPD in the JSON read field but it just tells me that's not a valid URL.
    Is what I'm trying possible? The documentation seems to indicate it is but I cant find any solid guide on how to get JSON read to accept a Tasker variable
     
  2. Greg Williams

    Greg Williams New Member

    Joined:
    Mar 8, 2017
    Messages:
    7
    Likes Received:
    0
    I've never had a problem with it passing variables, just variables within variables. Can you paste the task description? Long tap the task name, select export then description to clipboard and paste in a reply.
     
  3. SonOfJorEl87

    SonOfJorEl87 New Member

    Joined:
    Mar 11, 2017
    Messages:
    7
    Likes Received:
    0
    Code (Text):
    Weather (49)     Abort Existing Task, Stay Awake  
    A1: GPS [ Set:On ]  
    A2: Perform Task [ Name:Latlong Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]  
    A3: HTTP Get [ Serve:pr: Port:http://api.openweathermap.org/data/2.5/forecast?lat=%LOC1&lon=%LOC2&units=metric&APPID=2673808b1dd8988e15312a1a3669da53 Path: Attributes: Cookies: User Agent: Timeout:10 Mime Type: Output File: Trust Any Certificate:Off ]  
    A4: Flash [ Text:%HTTPD Long:Off ]
    Not sure how much help this will be as I literally can't get the JSON read part of the task to save.
    After the above I go + Action >> Plugin >> AutoTools >> Json Read >> Configuration >> Json >> " %HTTPD " (minus quotes)
    If you hit Authenticate it flashes the error "The regex you have entered is not a valid URL". If you try to save it says the settings aren't valid and if I exit they'll be lost.
     
    Last edited by a moderator: Mar 13, 2017
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    You don't need to use the "Authenticate" option. Just use the URL normally and it should work. :)
     
: json, read, variable, api

Share This Page