Name: twitter-screen-name
Owner: TABLEFLIP
Description: Extract a twitter screen name from a twitter URL or `@username` string. Return `null` if not valid.
Created: 2016-02-19 11:54:55.0
Updated: 2016-02-19 11:56:45.0
Pushed: 2016-02-19 12:06:25.0
Homepage: null
Size: 4
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Extract a twitter screen name from a twitter URL or @username
string. Return null
if not valid.
twitterScreenName = require('twitter-screen-name')
terScreenName('http://twitter.com/_alanshaw') // -> _alanshaw
terScreenName('https://www.twitter.com/_alanshaw') // -> _alanshaw
terScreenName('http://twitter.com/_alanshaw/status/695527644901801984') // -> _alanshaw
terScreenName('@_alanshaw') // -> _alanshaw
terScreenName('_alanshaw') // -> _alanshaw
tc.
terScreenName('http://example.org/foo/') // -> null
terScreenName('toolongfortwitter') // -> null
tc.