why are there tweets longer that 140 characters?

82 views
Skip to first unread message

Jason Toy

unread,
Aug 4, 2011, 6:05:58 PM8/4/11
to Twitter Development Talk
I see some tweets going through my system that are over 140
characters, for example tweet id: 86955808553844736 is 284
characters.
Here is the actual tweet:
"<*)))>< <*)))>< <*)))>< <*)))><
<*)))>< <*)))>< <*)))>< <*)))><
<*)))>< <*)))>< <*)))>< <*)))><
<*)))>< <*)))>< <*)))>< <*)))><
#phish #sbix"

Do I need to encode it a special way to get it to fit under 140
characters or does this restriction not apply anymore? My processing
engine expects tweets to be under 140 characters.



Jeremy Dunck

unread,
Aug 4, 2011, 7:58:22 PM8/4/11
to twitter-deve...@googlegroups.com
Characters are not necessarily a single byte. Which are you counting?

> --
> Have you visited the Developer Discussions feature on https://dev.twitter.com/discussions yet?
>
> Twitter developer links:
> Documentation and resources: https://dev.twitter.com/docs
> API updates via Twitter: https://twitter.com/twitterapi
>
> Unsubscribe or change your group membership settings: http://groups.google.com/group/twitter-development-talk/subscribe
>

Jason Toy

unread,
Aug 5, 2011, 2:07:11 AM8/5/11
to Twitter Development Talk
I am counting unicode characters.

Jason Toy

unread,
Aug 5, 2011, 2:10:48 AM8/5/11
to Twitter Development Talk
I see how to fix it,I have to html unescape the tweet, is it safe to
html unescape all tweets ?

On Aug 4, 4:58 pm, Jeremy Dunck <jdu...@gmail.com> wrote:

Taylor Singletary

unread,
Aug 5, 2011, 10:22:23 AM8/5/11
to twitter-deve...@googlegroups.com
If you're never going to show a tweet in a HTML context, it would be safe to unescape the entitized characters. Tweets are often fed directly from an API call to an HTML context, which is why we protect against malicious HTML by escaping certain tags. Storing as received is likely the best bet.

@episod - Taylor Singletary
Reply all
Reply to author
Forward
0 new messages