tableflip/twitter-screen-name

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

twitter-screen-name Build Status Dependency Status

Extract a twitter screen name from a twitter URL or @username string. Return null if not valid.

Example
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.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.