Is this still a todo or can I find the feature somewhere?
Do I best need Variable Split if no xml parsing is available?
<span id="localtime">(.*)</span>
In my Variable Search Replace as "Store Matches In" I set: %zeitaktuell, and now I hope that I get in this variable:
Aktuelle Zeit: Do, 10.10. 15:38 MESZ
because in the Source I read:
<span id="localtime">Aktuelle Zeit: Do, 10.10. 15:38 MESZ </span>
But I don't get the value, I get the name of the variable "%zeitaktuell", instead of the (only) match.
Even if there where no result, this variable should be empty at all.
In:
http://www.pocketables.com/2012/09/beginners-guide-to-tasker-part-4-variable-data-processing.html
I read only few lines about Search and Replace, and in:
http://tasker.dinglisch.net/userguide/en/matching.html
I don't find anything about the "Store Matches In" at all.
Is there any working example for this function (search and replace)?
Thanks.
frank
...
For extracting the desired text, it would be easier to use variable split.
...
Export description to clipboard
Jay M
--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/mrZmADN2Jnc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.
...
but now I need to parse it with Tasker. On the todo page of Tasker (http://tasker.dinglisch.net/todo.html) I found this line:
parse XML to pull out specified bits (tag=xxx attrname=yyy attrval=zzz etc), or is search-replace pattern-matching sufficient ?
Afaik, OpenWeatherMaps supports JSON natively also, which is easier to use with JS, imho...
var http = new XMLHttpRequest();
var url = "http://api.openweathermap.org/data/2.5/weather?q=london,uk&units=metric&APPID=xxxYourApiIDxxx";
http.open("GET", url, false);
http.send();
var data = JSON.parse(http.responseText);
// get current temperature
var temp = data.main.temp;
// get current windspeed
var speed = data.wind.speed;
// get description
var description = data.weather[0].description;
JSON data example
{
"coord": {
"lon": -0.13,
"lat": 51.51
},
"weather": [
{
"id": 803,
"main": "Clouds",
"description": "broken clouds",
"icon": "04n"
}
],
"base": "cmc stations",
"main": {
"temp": 7.48,
"pressure": 1010,
"humidity": 66,
"temp_min": 5,
"temp_max": 10
},
"wind": {
"speed": 3.6,
"deg": 210
},
"clouds": {
"all": 76
},
"dt": 1459370673,
"sys": {
"type": 1,
"id": 5091,
"message": 0.0052,
"country": "GB",
"sunrise": 1459316259,
"sunset": 1459362752
},
"id": 2643743,
"name": "London",
"cod": 200
}