Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

insert line break in tweet from URL?

So I have a script like this now: popUp("https://twitter.com/intent/tweet?text=" + greeting + poem + " -&url=" + siteURL, 704, 260);

The "poem" is a haiku and I'd love to have it like: line1 line2 line3

rather than line 1 // line 2 // line 3, which it is now. I tried inserting stuff like \n in there to no avail. "Poem" is constructed simply like line1 + " // " + line2 ...

like image 878
prismspecs Avatar asked Oct 23 '13 18:10

prismspecs


People also ask

How do you add a line break in URL?

You can try sending the standard carriage return ("\r") and line feed character ("\n") [line. separator] instead of just "/n". Further, if you can, probably browse through the external sms gateway API docs on how they read a newline character, It may vary from standards.

How do you put line breaks in tweets?

To add line break in Twitter, tapping ”Enter” or “Return” key while typing the tweet either in mobile or MAC or windows. A line break in Twitter means blank space between two lines text.

How do you skip lines on Twitter on iPhone?

2. The Return key is located in the bottom-right corner, next to the space bar. Are you trying to start a new line when composing a tweet in the Twitter app on your iPhone? You will most probably automatically hit the Backspace key, located exactly where the Enter/Return button is usually displayed.

How do you put line breaks on iPhone?

Double-tap where you want the break to occur. Tap Insert, then tap Line Break or Page Break.


1 Answers

As you've guessed, newline characters cannot appear in URLs.
Using a random escaping mechanism won't do you any good; you need to URL-encode the newline:

https://twitter.com/intent/tweet?text=abc%0adef

like image 54
SLaks Avatar answered Sep 21 '22 15:09

SLaks