Hello,
I have a tiddler named “Heures lever/coucher soleil get” which gives me a button to manually launch a procedure that retrieves a JSON and puts it in the tiddler “Heures lever/coucher soleil données”.
Heures lever/coucher soleil get
\whitespace trim
\procedure store-fetched-output()
<$action-setfield $tiddler="Heures lever/coucher soleil données" text=<<data>>/>
\end
\procedure http-get()
<$action-sendmessage $message="tm-http-request"
url="https://api.sunrisesunset.io/json?lat=LATITUDE&lng=-LONGITUDE&timezone=UTC&time_format=24"
method="GET"
oncompletion=<<store-fetched-output>>
/>
\end
<$button class="tc-btn-invisible" actions=<<http-get>>>{{$:/core/images/refresh-button}}</$button>
Example : Heures lever/coucher soleil données
{"results":{"date":"2025-03-10","sunrise":"06:27:02","sunset":"17:59:32","first_light":"04:41:00","last_light":"19:45:34","dawn":"05:55:22","dusk":"18:31:12","solar_noon":"12:13:17","golden_hour":"17:17:06","day_length":"11:32:29","timezone":"UTC","utc_offset":0},"status":"OK"}
I’ve added this tag “$:/tags/StartupAction” to the file “Heures lever/coucher soleil get” so that the ActionWidget is executed on startup, but nothing happens.
Any ideas?