Twitter new line syntax?

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

Moderator: Mattk

Post Reply
Ciemon
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: Fri Mar 18, 2022 8:02 pm

Twitter new line syntax?

Post by Ciemon »

I'm setting up a twitter feed and am trying to break up output text onto new lines for temp, wind etc but I can't get it to work.

When I test the meteobridge output using email using \n has the desired affect, but using the same input for twitter doesn't work, and prevents the tweet completely.

Have I missed something? It would be good to use the 280 character limit without it looking too busy, line breaks would really help with that.

Thanks.
Regards,
@Ciemon
@VillageWeather
villageweather.net
Ciemon
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: Fri Mar 18, 2022 8:02 pm

Re: Twitter new line syntax?

Post by Ciemon »

Is anyone able to post an example of a Twitter message that uses a line break?
Regards,
@Ciemon
@VillageWeather
villageweather.net
User avatar
wvdkuil
Platinum Boarder
Platinum Boarder
Posts: 606
Joined: Sun Jul 24, 2011 8:00 pm
Location: Belgium
Contact:

Re: Twitter new line syntax?

Post by wvdkuil »

I did not use the Meteobridge twitter upload.

But using my own PHP script a new line is simple entered as hitting the new-line-key. Not by using a special value.
An empty line one gets by using the new-line-key twice.

Maybe it works the same with the texts in the Meteobridge.
If that not works, one can probably copy / paste a new-line from another document.

Succes, Wim
Ciemon
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: Fri Mar 18, 2022 8:02 pm

Re: Twitter new line syntax?

Post by Ciemon »

Thanks Wim,

I know it should be possible but the meteobridge syntax doesn’t work, and neither does your suggestion I'm afraid, but thank you.
Regards,
@Ciemon
@VillageWeather
villageweather.net
User avatar
jasonmfarrow
Gold Boarder
Gold Boarder
Posts: 249
Joined: Mon May 25, 2020 4:21 pm
Contact:

Re: Twitter new line syntax?

Post by jasonmfarrow »

I think that this is a Twitter OAUTH/API issue and the use of line-feed and the type of quotes in the tweet text. This short thread (from 2018) has some commentary on the issue: https://cmsdk.com/php/new-line-in-twitt ... oauth.html.

Whether this can be fixed will depend on how Boris has coded the Twitter-post service within Meteobridge. The example API code (this link https://github.com/twitterdev/Twitter-A ... e_tweet.py, points to a python example) has the payload "tweet" in double quotes.

It may require some collaboration and experimentation from Boris to correctly facilitate the use of \r\n or equivalent <CR><LF> codes to correctly push through the Twitter API.
Regards
Jason
https://jmfweather.uk | @jasonmfarrow
Ciemon
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: Fri Mar 18, 2022 8:02 pm

Re: Twitter new line syntax?

Post by Ciemon »

Thank you for finding that Jason.

As always there's a priority for software development, and I hope this can make it onto Boris' list.
Regards,
@Ciemon
@VillageWeather
villageweather.net
Post Reply