Very interesting. Temporarily I've been duplicating my Twitter posts to 
Mastodon using IFTTT but plan to make the change to native support. 
Would you mind posting a link to your Mastodon profile so we can see the 
results?

On Wednesday, December 21, 2022 at 8:16:34 AM UTC-6 mfr...@gmail.com wrote:

> On 21/12/2022 07:45, Glenn McKechnie wrote:
> > Hi Chris,
> > 
> > Nothing like finding a day where you can plunge, guilt free, into the
> > ToDo list. I didn't have a Snow day, but I borrowed yours!
> > 
> > I started re-purposing Matthew Walls twitter extension (which runs
> > uses RestX - [StdRESTful] ) and have had good success with it in the
> > half day or so that it's been runnng. Still some work to do on it
> > (phttt) but the text part works well enough.
> > 
> > Your use of the template is interesting - that gives it a bit of 
> flexibility.
> > 
> > I'll mull that one over while I continue down the media (image) path.
> > 
> > Alpha is at ...
> > https://github.com/glennmckechnie/weewx-mastodon
> > 
> > 
> > On 21/12/2022, Chris Alemany <chri...@gmail.com> wrote:
> >> The snowy weather here on Vancouver Island has given me some unexpected
> >> time to work on this. I now have a working template file and python 
> script
> >>
> >> that will produce and post weewx data to a Mastodon account.
> >> Just setup an account on your favourite Mastodon server,
> >> mark it as a bot,
> >> create an API/Client Key (under development in your account's 
> preferences)
> >> install the template file to one of your skins (I just added it to the
> >> Standard skin.
> >> put the python file somewhere it can be run with cron
> >> run the python file with a command like this:
> >>
> >> sudo python3 weewx_to_mastodon.py --server https://mstdn.ca --wxdata
> >> https://mywebpage.com/mastodon.json --api_key biglongstring234fssdf
> >>
> >> I've attached my working files if anyone is itching to have it, excuse 
> the
> >> messy code but it should be fairly self explanatory. You should only 
> really
> >>
> >> need to modify the values in the json.tmpl file.
> >>
> >> On Sunday, December 18, 2022 at 3:40:31 PM UTC-8 Chris Alemany wrote:
> >>
> >>> Here is the promised link to the fellow who created a Python script 
> from
> >>> cumulus on Mac to Mastodon/ActivityPub:
> >>> 
> https://github.com/buffaloseven/CumulusMX-Customizations/tree/main/integrations
> >>>
> >>> Sent from my iPhone
> >>>
> >>> On Dec 15, 2022, at 6:24 AM, Chris Alemany <chri...@gmail.com> wrote:
> >>>
> >>> Hi all,
> >>>
> >>>
> >>>
> >>> Has anyone had a go at having weewx post to Mastodon/Fediverse, either 
> to
> >>>
> >>> an existing @user@server or as an independent instance?
> >>>
> >>> There is at least one fellow who has written some Python to do it from 
> his
> >>>
> >>> cumulus based system. I will share his GitHub project if someone thinks
> >>> they can do it.
> >>>
> >>> Cheers
> >>> Chris
> >>>
> >>> Sent from my iPhone
>
> I've been posting to Mastodon for a while now and I've done it a bit 
> differently.
>
> In skin.conf of what ever skin you are using (Seasons for me) I added:
> [[MastodonHourly]]
> encoding = strict_ascii
> template = mastodon.out.tmpl
>
> mastodon.out.tmpl contains:
> Temp: $current.outTemp Humidity: $current.outHumidity\nPressure: 
> $current.barometer\nWind: $current.windDir.ordinal_compass, 
> $current.windSpeed (ave), $current.windGust (gust)\nRain Rate: 
> $current.rainRate Rain Total: $day.rain.sum\nSolar Radiation: 
> $current.radiation UV: $current.UV\nSoil Moisture: $current.soilMoist1
>
> Lastly I have this python script run hourly from a Crontab using 
> Mastodon.py and I can upload an image from my webcam at the same time:
>
> #!/usr/bin/env python3
> from mastodon import Mastodon
> from datetime import datetime
>
> # Set up Mastodon
> mastodon = Mastodon(
> access_token = '',
> api_base_url = ''
> )
>
> photo_path = '/var/www/html/webcam.jpg'
> now = datetime.now()
> spoiler = 'Live weather for #Yeovil at ' + now.strftime('%d/%m/%y %H.00')
>
> f = open('/var/www/html/weewx/mastodon.out','r')
> media = mastodon.media_post(photo_path)
> content = f.read()
> tweet = content.replace("\\n","\n")
> mastodon.status_post(tweet, media_ids=media, spoiler_text=spoiler)
> f.close()
>

-- 
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/d182632f-852d-4f4d-b810-93d349322485n%40googlegroups.com.

Reply via email to