Intermittent Twitter error - "closing paren expected"

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

Moderator: Mattk

Post Reply
sjmeff
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Sun Oct 04, 2015 5:30 pm

Intermittent Twitter error - "closing paren expected"

Post by sjmeff »

Hi - I've used the same Twitter script for a while but it recently started intermittently failing (perhaps with the recent upgrade of Meteobridge?).

I'm on Meteobridge 3.1

The script is:

Code: Select all

#SandySpring #MD #MoCo [th0temp-act=F.1:--]°F (feels like [th0heatindex-act=F.1:--]°F) · Humidity: [th0hum-act=.0]٪ · Rain: #if#{*[rain0total-daysum]=0.0*}#then#0 in#else#[rain0total-daysum=in.2:---]in#fi# · Wind: [wind0dir-act=endir:---] [wind0wind-act=mph.1:--] to [wind0wind-max10=mph.1:--] mph
It runs fine for a while and then occasionally will throw this error:
"Error: sh: closing paren expected sh: closing paren expected can not post tweet (duplicate) (no more tries)"

Any ideas?
Last edited by sjmeff on Tue Oct 04, 2016 4:30 pm, edited 1 time in total.
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Intermittent Twitter error - "closing paren expected"

Post by admin »

I guess it cannot handle the degree symbols.
weeramateur
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: Tue Oct 04, 2016 9:09 am

Re: Intermittent Twitter error - "closing paren expected"

Post by weeramateur »

admin wrote:I guess it cannot handle the degree symbols.
that's possible
Attachments
2016-10-04 09_07_54-(3) Twitter.png
2016-10-04 09_07_54-(3) Twitter.png (13.61 KiB) Viewed 4541 times
sjmeff
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Sun Oct 04, 2015 5:30 pm

Re: Intermittent Twitter error - "closing paren expected"

Post by sjmeff »

Thanks for the replies.

I tested removing various characters -- ° · ٪ -- but still saw the error. Finally I tried removing the parenthesis around the "feels like" part and I haven't seen the error again. It's always been an intermittent issue, but this has been running for ~12 hrs so far, so I will just use the updated script.

Code: Select all

#SandySpring #MD #MoCo [th0temp-act=F.1:--]°F · Feels like [th0heatindex-act=F.1:--]°F · Humidity: [th0hum-act=.0]٪ · Rain: #if#{*[rain0total-daysum]=0.0*}#then#0 in#else#[rain0total-daysum=in.2:---]in#fi# · Wind: #if#{*[wind0wind-max10]>0.0*}#then#[wind0dir-act=endir:---] [wind0wind-act=mph.1:--] to [wind0wind-max10=mph.1:--] mph#else#0 mph#fi#
Thanks again!
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Intermittent Twitter error - "closing paren expected"

Post by admin »

I see in your template that you don't have defined default values for all variables (th0hum-act, rain0total-daysum in if clause).
This might also cause trouble with the square brackets when no sensor data for this sensor available.
sjmeff
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Sun Oct 04, 2015 5:30 pm

Re: Intermittent Twitter error - "closing paren expected"

Post by sjmeff »

admin wrote:I see in your template that you don't have defined default values for all variables (th0hum-act, rain0total-daysum in if clause).
This might also cause trouble with the square brackets when no sensor data for this sensor available.
How do I set defaults? I didn't see that in the docs. Thanks!
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Intermittent Twitter error - "closing paren expected"

Post by admin »

It is done with the colon ":", please see section about templates in the wiki.
User avatar
WA4OPQ
Senior Boarder
Senior Boarder
Posts: 44
Joined: Mon Feb 29, 2016 5:36 am
Location: Tennessee, USA About 40 miles west of Nashville y'all.
Contact:

Re: Intermittent Twitter error - "closing paren expected"

Post by WA4OPQ »

I'm having the same problem, but with a very simple template:
Today's high temperature for Hickman County (8.5 miles NE of Centerville) was [th0temp-dmax=F.1:--] ºF. The low temperature was [th0temp-dmin=F.1:--] ºF

I can make it work by replacing the parentheses with commas. But I would like to be able to use parentheses in tweets.
Post Reply