beatngu 65 Posted March 17, 2013 Report Share Posted March 17, 2013 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 ? Quote Link to post Share on other sites
gabel 51 Posted March 17, 2013 Report Share Posted March 17, 2013 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)) Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted March 17, 2013 Report Share Posted March 17, 2013 wrap the second set variable and alert inside a if statement. if comparison $text length > 140then set and alertelse nothing so that it doesn't bring back a blank for having less then the characters your trying to return. Quote Link to post Share on other sites
beatngu 65 Posted March 17, 2013 Author Report Share Posted March 17, 2013 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! Quote Link to post Share on other sites
illmill 87 Posted March 19, 2013 Report Share Posted March 19, 2013 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??? Quote Link to post Share on other sites
VaultBoss 310 Posted March 19, 2013 Report Share Posted March 19, 2013 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) Quote Link to post Share on other sites
illmill 87 Posted March 21, 2013 Report Share Posted March 21, 2013 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. Quote Link to post Share on other sites
VaultBoss 310 Posted March 21, 2013 Report Share Posted March 21, 2013 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? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.