Forcing a line break in tweets from a URL?

Discussion in 'HTML & Website Design' started by qwikad.com, Jul 11, 2015.

  1. #1
    When I use:

    <a href="h t t p://twitter.com/share?url=h t t p://someurl.com&text=Some text here:&hashtags=something" target="_blank">Tweet</a>

    It tweets:

    Some text here: h t t p://someurl.com #something

    I want it to be:

    Some text here:

    h t t p://someurl.com

    #something



    Someone on stackoverflow suggested using %0 or &#010; but they didn't do the trick for me. Anyone know what breaks lines when tweeting from a URL?
     
    qwikad.com, Jul 11, 2015 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    I thought twitter didn't allow carriage returns -- just like their crappy useless character limit that makes me not even bother TRYING to use it in the first damned place.

    Of all the social media success stories, Twitter is the one I understand the least.
     
    deathshadow, Jul 11, 2015 IP
    billzo likes this.
  3. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,279
    Likes Received:
    1,696
    Best Answers:
    31
    Trophy Points:
    475
    #3
    You can do the returns manually, so there has to be a way to do it via a code, I presume.
     
    qwikad.com, Jul 12, 2015 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    Uhm, have you tried %0A?

    //twitter.com/share?url=h t t p://someurl.com&text=Some text here:%0A&hashtags=something

    Could be because you are passing fields it's stripping them if they're at the beginning or end of the url or hashtags... you might only be able to do it in the text field.

    BTW this is 2015, not 1997, why are you using the TARGET attribute to piss on usability and shove new windows or tabs down users throats? There's a REASON it's deprecated in non frame-set pages.
     
    deathshadow, Jul 12, 2015 IP
  5. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #5
    To add to @deathshadow's comment: Every graphic browser that I know of let's the user decide to have a new window or tab open or not, when he clicks the link. Why are you removing his choice? That's just damned impolite.

    If you're thinking about your needs instead of the users' needs, you're not thinking.

    gary
     
    kk5st, Jul 12, 2015 IP
  6. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,279
    Likes Received:
    1,696
    Best Answers:
    31
    Trophy Points:
    475
    #6
    So, ok, it's possible to do a return between the text and the URL with %0A

    Example: http://jsfiddle.net/3GMkf/49/

    Not sure how to do the same for the hashtag. I am sure it's possible.
     
    qwikad.com, Jul 12, 2015 IP
  7. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,279
    Likes Received:
    1,696
    Best Answers:
    31
    Trophy Points:
    475
    #7
    I got it. I had to switch some things around to make it work:

    http://jsfiddle.net/3GMkf/68/

    Too bad I can't set my own post as the best answer.
     
    qwikad.com, Jul 12, 2015 IP
  8. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,279
    Likes Received:
    1,696
    Best Answers:
    31
    Trophy Points:
    475
    #8
    By the way @kk5st when it comes to tweeting using customized URLs (like the one above), it automatically closes the window after the tweet is sent. So, it's really no big deal if it opens in a new window.

    And... I deleted the post (the one you were replying to) because I didn't want this thread to turn into some circus. But you happened to catch it right before I deleted it. Sorry about that.
     
    qwikad.com, Jul 12, 2015 IP
  9. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #9
    That's a Good Thing, especially if the new window is modal, causing the user to either do it or cancel.

    Likewise, since mine is no longer applicable.

    You could set mine as the best answer. Oh, wait. I deleted that, didn't I? :( Maybe next time.

    gary
     
    kk5st, Jul 12, 2015 IP
    qwikad.com likes this.
  10. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,279
    Likes Received:
    1,696
    Best Answers:
    31
    Trophy Points:
    475
    #10
    @deathshadow Yeah, we've beaten this horse half to death already. Please, read my lips: I.... don't.... care....

    If it ain't broken, don't fix it, Mr. Deathshadow.
     
    qwikad.com, Jul 13, 2015 IP
  11. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #11
    Unless of course it is broken, is bad accessibiliy and/or functionality, and we've been told for nearly TWO DECADES to stop doing that.

    But much like all the other sleazeball halfwit HTML crap that never should have existed in the first place -- like CENTER, ALIGN, VALIGN, WIDTH, HEIGHT, CELLPADDING, CELLSPACING, FONT, BORDER, BGCOLOR, tables for layout, placeholders instead of labels, lack of labels and fieldsets, and using tags just because of what they look like instead of what they mean -- people will, as you so eloquently put it, "not care" and continue to sleaze out broken inaccessible bloated train wrecks of how not to build website.... mostly due to an ignorance and apathy that finds it's roots in blindness, comfort and wishful thinking.

    Hell, most people don't even seem to realize how mouth-breathingly stupid putting "Copyright &copy;" is in their footers.
     
    deathshadow, Jul 13, 2015 IP
  12. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,279
    Likes Received:
    1,696
    Best Answers:
    31
    Trophy Points:
    475
    #12
    If this is your way of judging someone's intelligence, then you are one exciting, tenderhearted (almost like a teddy bear) fella everyone wants to hang out with. By the way, you are in my "People You Ignore" thingy, since I got sick and tired of all the effing verbal garbage that comes from the folks like yourself. Don't forget, no matter how big this forum is, those who stop by it often enough will start placing you and the likes in the ignored monkeys trap, too. Some are just not aware that that thing exists. One day you will end up talking to yourself. I swear I will never reply to your garbage (or any) comments again. Ever.

    ScreenHunter_176 Jul. 14 21.43.gif
     
    qwikad.com, Jul 14, 2015 IP
  13. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #13
    What people need is to get less butt-hurt when someone isn't being nice, cuddly and polite. /ignore on a person with a lot of knowledge on the subjects mainly discussed here, albeit with differing opinions from your own, is your loss, not his. If you ignore just the "hurtful" parts of what he says, and take to heart the things he tries to tell you, and others, maybe you'd be a better coder for it - because <deity> knows I don't agree with him on many points, but that doesn't mean I can't appreciate his effort to educate the masses, and his knowledge about programming.
     
    PoPSiCLe, Jul 15, 2015 IP
    malky66 likes this.
  14. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,279
    Likes Received:
    1,696
    Best Answers:
    31
    Trophy Points:
    475
    #14
    Nonsense. Where in real life do you find this applicable? This forum isn't an exception. Let's say I needed to hire someone to code something for me. Do you think I'd hire deathshadow knowing what he is like? Hell, no. I absolutely don't care what he knows. He's one big-mouth troll and an unfunny hater of people. We all avoid people like that in our day to day life, the same should be done here.
     
    qwikad.com, Jul 15, 2015 IP
  15. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,279
    Likes Received:
    1,696
    Best Answers:
    31
    Trophy Points:
    475
    #15
    Masses? Really? Like unwashed masses? I didn't immigrate to the US from Russia to listen to some buffoon educate masses. If you know what I mean. I don't understand people who want to act like pussies just because they respect someone's "knowledge". So, stop with that.
     
    qwikad.com, Jul 15, 2015 IP
  16. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #16
    Uhm... Come again? You're the one acting butt-hurt - not me. I don't CARE what people sound like, I listen to what they say, and what reasoning they have. I don't care if someone yells or curses or calls me an idiot - as long as they can back that up with knowledge, arguments and reasoning. I can be diplomatic if I'm talking to people, but being diplomatic in writing takes to fucking long - just say what needs to be said, and get on with it. Short, concise sentences (well, @deathshadow has a bit left on that part) :) and to-the-point.
    I don't mind being told I'm wrong, as long as there's arguments for WHY I'm wrong. Politeness for politeness sake and PCness is something of a pet peeve for me, as in there is nothing worse - it doesn't mean one has to be a troll in every setting, but as long as a minimum of effort is put in to not unnecessarily offend, that's good enough for me.
     
    PoPSiCLe, Jul 16, 2015 IP
  17. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #17
    ... and thank you for pretty much proving my point; if you don't actually care about building proper accessible sites that are actually useful to users and easier to host, why aren't you out flipping burgers for a living?

    Of course, it's always great to see the "Wah, wah, I don't want to hear it" response; the true hallmark of confirmation bias and cognitive dissonance.

    I swear, it's like some people making websites just WANT to be failures and do everything possible to ensure it.
     
    deathshadow, Jul 16, 2015 IP