vetzki
Philosoph
- 1.750
Da ich gerade damit rumwurschtle (evtl. hilfts jemand anders auch) und ichs später wieder finde, eine Task um ohne zusätzliche App das Wetter abzufragen und in einer variable (ohne datei auf der sd karte) zu speichern.
Code:
Wetter Temperatur (6)
A1: If [ %locsearch < 3 ]
A2: Variable Set [ Name:%locsearch To:%locsearch+1 Do Maths:On Append:Off ]
A3: Get Location [ Source:Net Timeout (Seconds):15 Continue Task Immediately:Off Keep Tracking:Off ]
A4: If [ %LOCNACC > 100 | %LOCN !Set ]
A5: Goto [ Type:Action Number Number:1 ]
A6: Else
A7: Variable Set [ Name:%loc To:%LOCN Do Maths:Off Append:Off ]
A8: End If
A9: Else
A10: Notify [ Title:Position nicht gefunden || zu ungenau Text:Pos: %LOCN (Genauigk: %LOCNACC) Icon:null Number:0 Permanent:Off Priority:3 ]
A11: Stop [ With Error:On Task:Wetter Temperatur ]
A12: End If
<loc1 = lat, loc2 = lon>
A13: Variable Split [ Name:%loc Splitter:, Delete Base:On ]
A14: Run Shell [ Command:wget "http://api.openweathermap.org/data/2.5/weather?lat=%loc1&lon=%loc2&lang=de" -O - Timeout (Seconds):0 Use Root:Off Store Output In:%stdout Store Errors In: Store Result In: ]
A15: Variable Split [ Name:%stdout Splitter:, Delete Base:On ]
<Wetterlage (klar, bewölkt, etc.)>
A16: Variable Split [ Name:%stdout5 Splitter:: Delete Base:On ]
<Temperatur>
A17: Variable Split [ Name:%stdout8 Splitter:: Delete Base:On ]
A18: Run Shell [ Command:Temp=%stdout83;
Temp=${Temp%.*};
Temp=${Temp%[0-9]};
echo $Temp; Timeout (Seconds):0 Use Root:Off Store Output In:%temperature Store Errors In: Store Result In: ]
A19: Say [ Text:momentan %stdout52 bei %temperature ° Engine:Voice:com.google.android.tts:deu-deu Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ]
Zuletzt bearbeitet: