Jump to content
UBot Underground

Anyone got a easy way to shrink text to 140 chars?


Recommended Posts

Im having problems to to find a way to shrink/shorten text to max 140 chars.

Does anyone have a smart way of handeling this ?

Link to post
Share on other sites

quick example

 

set(#text, "Unlike other clunky, bloated automation suites, UBot Studio has a clean, simple, drag-and-drop interface that works with you, not against you, allowing point-and-click automation on any website, without requiring you to become a programmer to use it.", "Global")
alert($text length(#text))
set(#test2, $substring(#text, 0, 140), "Global")
alert($text length(#test2))
Link to post
Share on other sites

Thanks Gabel for a great example this is what i have been trying to do for the past hours.

And thanks TJ for the tweek of the example!

Link to post
Share on other sites

Yeah, I was actually just working on this today.  I've got a question, though, about the $substring.  Does it count white spaces or how is this calculated?

 

I'm assuming that because you want 140 characters or less, that it's for twitter.  If I do this:

set(#test2, $substring(#text, 0, 140), "Global")

 

it doesn't work.  The text in twitter will be too long.  Even if I set it for 130 characters, sometimes it will still come out too long.  I usually aim for 125 just to be safe.  Why does it work this way, or can someone please explain how this works???

Link to post
Share on other sites

Are you having expandable substrings within?

Also, for 140 characters, you need to count them up to 139 not 140 (they start to be counted in UBS at 0 not 1)

Link to post
Share on other sites
Are you having expandable substrings within?

Also, for 140 characters, you need to count them up to 139 not 140 (they start to be counted in UBS at 0 not 1)

I'm not sure what you mean by 'expandable substrings within'.

 

Yeah, but if I do it for even 130 characters then it ends up being longer than 140 and won't post.

Link to post
Share on other sites

Expandable substrings would be links that TW would change, the result being most times shorter than the original, but also could be longer in some particular cases.

However, TW would count the initial length (with all the chars from your original long URL) towards the total count, even if, after being shrunk, the total length of the tweet would become less than the 140 limit.

 

Can you post an example of a 140 chars string that you consider valid and that you can't post to TW?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...