I need some help with creating some Twitter Scripts

All about the standard Meteobridge devices based on mobile routers from TP-Link, D-Link, ASUS

Moderator: Mattk

Post Reply
User avatar
D2149
Senior Boarder
Senior Boarder
Posts: 45
Joined: Mon Mar 07, 2016 12:30 am
Location: Bass Lake - California USA (Southern Sierra Nevada near Yosemite National Park)
Contact:

I need some help with creating some Twitter Scripts

Post by D2149 »

Hello everyone.

I have been attempting to re-create some popular Twitter based data strings that our station previously provided. That option in our weather software broke when Twitter changed their API back in 2012. Until I purchased my Meteobridge PRO I had no way of providing these hourly and condition based strings of weather data which go from our station's Twitter account over to our station's facebook page.

I have managed to get the [act] type delivery to work just fine, but I have another type of string posted below that relies on daytime high values that also need to include the time stamp of those highs displayed in the 12 hour AM-PM time format.

Here is the Twitter string I need to produce with the MBP as it would appear to users on Twitter and facebook:

Solar Highs Today: Temperature: 90.8 F at 3:23 PM * Solar Radiation: 786.00 watts/m^2 at 1:02 PM * UV: 5.50 at 1:01 PM

So far, I have found no way to produce this string using the existing scripting options shown in the Meteobridge Wiki. Everything using timestamps appears to be in 24 hour/Military Time format only. Any of you running a station that serves a community in the USA knows that folks expect/desire their events in the 12 hour time format, not military time.

I personally don't care for it either and much prefer my time stamps in 12 hour format. If the MB scripting library allows this to be done, it sure isn't something that jumps off the page!

Do we have any Meteo script experts out there that can create such a script for me?

You would be doing me a HUGE favor if you could provide me with the MB formatted script to deliver the above mentioned string exactly as you see it here in this post. While I could likely work with bits and pieces, I would prefer the whole thing so that I know in advance that it works. I try to avoid doing too much testing of scripts on our Twitter account due to the number of users who follow it.

I am sure many current and future MB and MBP owners would also appreciate having access to such a script, as well as other common data strings that could be posted to Twitter which have already been tested to be contained within that service's character limitations and free of any characters not supported by Twitter.

Thanks in advance for your help. :)
User avatar
D2149
Senior Boarder
Senior Boarder
Posts: 45
Joined: Mon Mar 07, 2016 12:30 am
Location: Bass Lake - California USA (Southern Sierra Nevada near Yosemite National Park)
Contact:

Re: I need some help with creating some Twitter Scripts

Post by D2149 »

I was told that this forum had a lot of Meteobridge scripting experts hanging around. ??

Where are you guys?
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: I need some help with creating some Twitter Scripts

Post by admin »

update released yesterday supports AM/PM timestamps for min/max events.

Template

Code: Select all

[th0temp-dmintime=apm.ij]:[th0temp-dmintime=apm.kl][th0temp-dmintime=apm.op]
reports the time stamp of lowest outdoor temperature of today in 12 hour AM/PM notation, like "12:34AM"
User avatar
D2149
Senior Boarder
Senior Boarder
Posts: 45
Joined: Mon Mar 07, 2016 12:30 am
Location: Bass Lake - California USA (Southern Sierra Nevada near Yosemite National Park)
Contact:

Re: I need some help with creating some Twitter Scripts

Post by D2149 »

admin wrote:update released yesterday supports AM/PM timestamps for min/max events.

Template

Code: Select all

[th0temp-dmintime=apm.ij]:[th0temp-dmintime=apm.kl][th0temp-dmintime=apm.op]
reports the time stamp of lowest outdoor temperature of today in 12 hour AM/PM notation, like "12:34AM"
THANK YOU!

This works GREAT! :D I had my version up and running in a couple of minutes! :)

Here is mine:

Code: Select all

Solar Highs: Temp: [th0temp-dmax=F.1:--] °F at [th0temp-dmaxtime=apm.ij]:[th0temp-dmaxtime=apm.kl] [th0temp-dmaxtime=apm.op] * Heat Idx: [th0heatindex-dmax=F.1:--] °F at [th0heatindex-dmaxtime=apm.ij]:[th0heatindex-dmaxtime=apm.kl] [th0heatindex-dmaxtime=apm.op] * UV index: [uv0index-dmax] at [uv0index-dmaxtime=apm.ij]:[uv0index-dmaxtime=apm.kl] [uv0index-dmaxtime=apm.op] * Solar: [sol0rad-dmax] w/m2 at [sol0rad-dmaxtime=apm.ij]:[sol0rad-dmaxtime=apm.kl] [sol0rad-dmaxtime=apm.op]
Looks like this:

Solar Highs: Temp: 53.2 °F at 11:18 AM * Heat Idx: 53.2 °F at 11:18 AM * UV index: 1.9 at 10:44 AM * Solar: 309.0 w/m2 at 10:45 AM

One question... Is there any way to control for the CASE of the AM/PM from CAPS to lowercase am/pm. ??
User avatar
D2149
Senior Boarder
Senior Boarder
Posts: 45
Joined: Mon Mar 07, 2016 12:30 am
Location: Bass Lake - California USA (Southern Sierra Nevada near Yosemite National Park)
Contact:

Re: I need some help with creating some Twitter Scripts

Post by D2149 »

Here is another one of our completed Meteobridge Twitter strings. We post this one at the top of each hour.

Code: Select all

at [H][APM]: Temp: [th0temp-act=F.1:--] °F * RH: [th0hum-act.0=:--]﹪ * Dew: [th0dew-act=F.1:--] °F * Wind: [wind0wind-act=mph.1:--] mph > [wind0dir-act=endir:---] ** UV index: [uv0index-act] * Solar: [sol0rad-act] w/m2 * Pressure: [thb0seapress-act=inhg.2:--] inHg
Looks like this:

at 5PM: Temp: 51.1 °F * RH: 62﹪ * Dew: 38.5 °F * Wind: 3.1 mph > SE ** UV index: 1.0 * Solar: 605.0 w/m2 * Pressure: 30.12 inHg
User avatar
D2149
Senior Boarder
Senior Boarder
Posts: 45
Joined: Mon Mar 07, 2016 12:30 am
Location: Bass Lake - California USA (Southern Sierra Nevada near Yosemite National Park)
Contact:

Re: I need some help with creating some Twitter Scripts

Post by D2149 »

We had an odd UV time stamp in our "Solar Highs" string last night...

Solar Highs: Temp: 54.3 °F at 04:16 PM * Heat Idx: 54.3 °F at 04:16 PM * UV index: 5.7 at 00:54 PM * Solar: 1196.0 w/m2 at 01:19 PM

WHY did it return a 00: instead of the 12: expected from the data?

The string code itself looks to be correct with the same tags used for UV as any of the other data points. ??

Code: Select all

Solar Highs: Temp: [th0temp-dmax=F.1:--] °F at [th0temp-dmaxtime=apm.ij]:[th0temp-dmaxtime=apm.kl] [th0temp-dmaxtime=apm.op] * Heat Idx: [th0heatindex-dmax=F.1:--] °F at [th0heatindex-dmaxtime=apm.ij]:[th0heatindex-dmaxtime=apm.kl] [th0heatindex-dmaxtime=apm.op] * UV index: [uv0index-dmax] at [uv0index-dmaxtime=apm.ij]:[uv0index-dmaxtime=apm.kl] [uv0index-dmaxtime=apm.op] * Solar: [sol0rad-dmax] w/m2 at [sol0rad-dmaxtime=apm.ij]:[sol0rad-dmaxtime=apm.kl] [sol0rad-dmaxtime=apm.op]
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: I need some help with creating some Twitter Scripts

Post by admin »

Thanks for finding this. It is a bug that will be fixed with this weekend's update
Post Reply