I'm auto posting hourly weather updates to Mastodon and Bluesky with some PHP, because, why not :)

Back in the day, when Twitter was still Twitter, I always found it very cool to be able to post weather updates there, every hour, on the hour. But Elon killed that feature and tried to turn the platform into something it isn’t, and after that I just lost interest in Twitter.

Two other platforms that do old school Twitter things, are Mastodon and Bluesky.

I don’t know if someone else already did this too, but just for fun I decided to see if (with some help) I would be able to fabricate some PHP that would post weather updates to Mastodon and Bluesky.

So now I have two scripts, one for each platform. I have set two cron jobs, one for each script, to run the scripts every hour, and here we are.
Basically both scripts retrieve a WD wx##.html file, and then post its contents.

Mastodon allows for automated posting, they even have a checkbox for that so you can let followers know it is automated content.
I’m a bit hesitant about Bluesky though. I haven’t seen if they explicitly allow automated posting, but I also haven’t seen they explicitly forbid it.
//edit: I asked Bluesky support, they replied: it’s allowed.

Should anyone want to do the same, let me know, and I’ll send you the scripts. You will have to then implement it yourself on your own webserver though :slight_smile:

I’m happy with the result:


//edit 2024-11-24…

I never expected this much attention for it, but since several people have asked, I have now added the original scripts to this post.

post-to-mastodon.zip (2.0 KB)
post-to-bluesky.zip (2.2 KB)

Do keep in mind that:

  • There is 300 character limit for Bluesky which this script does not account for. So if you go over that, your content won’t get posted even though the script might say “success”.
  • The scripts contain several, specific to my goal, text replace actions. You can of course change or remove those.
  • I am not a programmer, and I have had some help left and right, so what we have here may look nasty to you if you are a programmer, so please bear with me. At least it posts :stuck_out_tongue:

If you feel like upgrading/improving the scripts, be my guest of course, but please do post the results here in this thread :sunglasses:

//extra edit…
As requested, this is the wxlocalXX.html source file Weather-Display enters values into, and uploads, and which the script then uses as a source for the posts.

Het weer in Hilversum van %date-year%-%date-month%-%date-day%, %time%u:

- Temperatuur: %temp%°C (%tempchangehour%)
- Rel. luchtv.: %hum%% (%humchangelasthour%)
- Dauwpunt: %dew%°C (%dewchangelasthour%)
- Luchtdruk: %baro% hPa (%barochangelasthour%)
- Wind: %avgspd% km/u %dirlabeldutch%
- Max. vlaag vorig uur: %maxgsthr%
- Regen vandaag: %dayrn%mm
- Zon: %VPsolar% W/m<sup>2</sup>
- UV: %VPuv%
1 Like

Yes please for the BlueSky script. I have a Mastodon account but I haven’t really used that platform. I’m not thinking of hourly updates…more like providing status updates as and when required, but I’m sure I can modify the script to decide when to send an update.

I would be interested in the Mastodon script. I tried sending weather updates to Mastodon using WD and an API token but, for some reason it didn’t work so, I’m just posting stuff manually.

1 Like

I have sent you a ZIP :slight_smile:

1 Like

I have sent you a ZIP :slight_smile:

Got it. Thanks a lot.

Fantastic! We would love the script for bsky posting! Is this for WD users only?

1 Like

Yes please for BlueSky

1 Like

I’d like to look at both please

1 Like

It’s not necessarily WD only. It’s a script that posts “something” to bsky.
This could be output from WD, but can also be from something else entirely.

I’ll send you a ZIP.

I have sent all of you ZIP files : - )

If you’re going to use Bluesky to post your own (human generated) content then consider setting up a second account to do hourly weather updates from. You might find people less likely to follow you if you’ve got hourly updates if they’re not interested in them.

Also if you have your own domain you can create a domain based handle, i.e. you don’t need to be something.bsky.social you can be me.mydomain.com if you prefer.

1 Like

Agreed. Good advice. I have it set up like that too (with domain based handles as well).

One for automated weather updates (with in the profile description this line: Automated account with hourly weather updates from Meteo Hilversum.):

And a personal one (that I happen to hardly use):

1 Like

Thank you very much, I’ve had a good look at the bsky script, and it works well. Thank you.

2 Likes

Hi, I’m new here so I take the opportunity to say hello to everyone. I’d like to have the script for BlueSky, where I’ve also recently landed from Ex-Twitter. Thanks!

2 Likes

Good morning. Just started with Bluesky and would be interested in that script!

Guy

2 Likes

Wow. What’s with all the interest seemingly all of a sudden :sweat_smile:

You both have ZIP files messaged to you.

2 Likes

Hmmm, I wonder if it’s anything to do with BSky adding over a million new users per day?

I’ve created a List of Weather-Watch.com users where I know your handle and I think I’ve followed you all too. If I’ve missed anyone, please let me know.

:sweat_smile:

Nice! Is it okay if I link to your list here? >> weather-watch.com users @ Bsky

I see you’ve included my personal account though, which is nice, but you left out my meteo account :crazy_face:

Of course.

Added. I looked for beun and forgot that it’s something different.

1 Like