ntwitter
ntwitter copied to clipboard
showUser doesn't differentiate between screen_names and ids correctly
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
This would probably do nicely:
if (item.match(/^\d+$/))