I managed this by modifying Axelle's code above in process_record():
ts = time.localtime()
if ts.tm_hour not in (0,6,12,18) or ts.tm_min != 0:
logdbg("This is not hour to tweet: %d" % ts.tm_hour)
return
That should tweet at 00:00, 06:00, 12:00 and 18:00. I'm not sure if this
will necessarily work if the archive interval is longer than 1 minute
though (my station is set to 1 minute)
On Monday, 28 March 2022 at 21:00:45 UTC+1 [email protected] wrote:
> Hello, I installed the twitter extension 'weewx-twitter' on my install
> (Debian 11 + WeeWX 4.7.0 + weewx-twitter 0.15) and it works fine. I
> modified the 'twitter.py' file to post a tweet to my weather twitter
> account and I wish the extension sends a tweet at a fixed time (0:00, 6:00,
> 12:00, 18:00). But if WeeWX or the computer restarts, tweets are sent the
> minutes the software starts (Ex: If WeeWX restarts at 4:12, the tweet is
> sent at 6:12, then 12:12, 18:12).
>
> Here is my part of the file:
>
> ``` ts = time.localtime()
> if (ts.tm_hour != 0 and ts.tm_hour != 6 and ts.tm_hour != 12 and
> ts.tm_hour != 18):
>
> logdbg("This is not hour to tweet: %d" % ts.tm_hour)
> return
> ```
>
--
You received this message because you are subscribed to the Google Groups
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/0e2633af-992f-41df-abf1-a18533ab0b68n%40googlegroups.com.