Page 1 of 1

Twitter new line syntax?

Posted: Sun Mar 20, 2022 10:39 am
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.

Re: Twitter new line syntax?

Posted: Wed Mar 30, 2022 11:25 am
by Ciemon
Is anyone able to post an example of a Twitter message that uses a line break?

Re: Twitter new line syntax?

Posted: Wed Mar 30, 2022 2:40 pm
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

Re: Twitter new line syntax?

Posted: Thu Mar 31, 2022 7:00 pm
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.

Re: Twitter new line syntax?

Posted: Fri Apr 01, 2022 10:28 am
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.

Re: Twitter new line syntax?

Posted: Fri Apr 01, 2022 12:41 pm
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.