ntwitter icon indicating copy to clipboard operation
ntwitter copied to clipboard

showUser doesn't differentiate between screen_names and ids correctly

Open ConnerPetzold opened this issue 13 years ago • 1 comments

There's no real way to do this actually, since just numbers is also a valid twitter username: http://twitter.com/1337

Perhaps a change that lets you specify if you're using id's or screen_names?

The other fix, if you still wanted to remain optimistic that most usernames aren't numbers (or don't start with numbers), would be to use a regex to check if it's a line instead of parseInt, because parseInt('20string') == 20.

https://github.com/AvianFlu/ntwitter/blob/master/lib/twitter.js#L582

ConnerPetzold avatar Feb 08 '12 23:02 ConnerPetzold

This would probably do nicely:

if (item.match(/^\d+$/))

ConnerPetzold avatar Feb 08 '12 23:02 ConnerPetzold