I used to use Weewx Twitter extension 
(https://github.com/matthewwall/weewx-twitter). 
Am I right to say it no longer works now with Twitter, unless you have a 
paid API subscription?

```
Aug 26 18:16:22 vegan weewx[20951] ERROR user.twitter: Failed attempt 3 of 
3: Twitter API returned a 403 (Forbidden), You currently have access to a 
subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media 
post, oauth) only. If you need access to this endpoint, you may need a 
different access level. You can learn more here: 
https://developer.twitter.com/en/portal/product
```

I suppose the idea is to move to Mastodon 
with https://github.com/glennmckechnie/weewx-mastodon ?

-- Axelle


On Tuesday, January 24, 2023 at 12:03:58 AM UTC+1 Glenn McKechnie wrote:

> There may be other ways, but use tags. This is the approach I've taken
> with weewx-mastodon.
>
> Using weewx tags ( https://weewx.com/docs/customizing.htm#Tags) in a
> template will generate the desired text output.
> You would however need to modify the twitter extension to post the
> output from a weewx generated template. (see below)
>
> eg:- template (snippet)...
>
> #Weather summary for Yesterday ($yesterday.dateTime.format("%A
> %d-%b-%Y")) at
> $station.location, Australia: \n
> Temp: (min: $yesterday.outTemp.min at $yesterday.outTemp.mintime)
> (max: $yesterday.outTemp.max at $yesterday.outTemp.maxtime)
>
> will generate the following text...
>
> #Weather summary for Yesterday (Monday 23-Jan-2023) at
> Messmate Farm, Broomfield, Victoria, Australia: \n
> Temp: (min: 11.6C at 06:35:01) (max: 35.1C at 16:46:02)
>
> https://github.com/glennmckechnie/weewx-mastodon
>
> If you're familiar with python it should offer a few hints ho w to
> post the template rather than the hardcoded format string, especially
> as it's a fork of Mathews weewx-twitter extension.
>
> I haven't incoporated the summary in weewx-mastodon - yet. It was on
> the mental ToDo list, but it would only need a timing section and some
> selection magic.
>
>
>
>
>
>
> On 24/01/2023, Jon B <jonbe...@gmail.com> wrote:
> > Does anyone have any ideas for this? I guess one way may be to read from
> > the previous day's archive_day entries in the database e.g.
> > archive_day_rain, although I'm not sure how easy/practical this would be
> >
> > On Saturday, 7 January 2023 at 02:33:15 UTC Jon B wrote:
> >
> >> Is it possible to use this Twitter extension to post the daily archived
> >> values for a given day? Ideally I'd like to set it to automatically 
> tweet
> >>
> >> once a day (say at 10am local time) giving the stats for the previous 
> day,
> >>
> >> e.g.:
> >>
> >> 06/01/2023: Max temperature: 12.3C, Min temperature: 2.3C, Max wind 
> gust:
> >>
> >> 35 mph, Total rainfall: 12.2 mm
> >>
> >> I have it working so that it only tweets once a day at 10am, but giving
> >> instantaneous values is a bit pointless at that tweet frequency
> >>
> >>
> >> On Saturday, 7 January 2023 at 02:24:33 UTC Jon B wrote:
> >>
> >>> 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 arnaud...@gmail.com 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 weewx-user+...@googlegroups.com.
> > To view this discussion on the web visit
> > 
> https://groups.google.com/d/msgid/weewx-user/9fcf620c-45f2-499d-8d9f-d91d1861160bn%40googlegroups.com
> .
> >
>
>
> -- 
>
>
> Cheers
> Glenn
>
> rorpi - read only raspberry pi & various weewx addons
> https://github.com/glennmckechnie
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/89dbd278-2128-464c-bc94-e4e1b0a5bde0n%40googlegroups.com.

Reply via email to