# social-media-link-parser

A parser which will evaluate user input and attempt to validate whether the input is a valid social media link for
known platforms. If the input is fuzzy-valid, a set of identifiers, urls, uris, and handles will be returned.

## Usage

### Spotify

```js
import { parse, SPOTIFY } from '@theorchard/social-media-link-parser';

console.log(
    parse({
        input: 'spotify:artist:0Bspkn3kU0UXTxrTs1KG9L',
        platform: SPOTIFY,
    })
);
```

```
{
    artistId: '0Bspkn3kU0UXTxrTs1KG9L',
    uri: 'spotify:artist:0Bspkn3kU0UXTxrTs1KG9L',
    url: 'https://open.spotify.com/artist/0Bspkn3kU0UXTxrTs1KG9L'
}
```

### Twitter

```js
import { parse, TWITTER } from '@theorchard/social-media-link-parser';

console.log(
    parse({
        input: '@therealjacobfowler',
        platform: TWITTER,
    })
);
```

```
{
    url: 'https://twitter.com/therealjacobfowler',
    handle: 'therealjacobfowler'
}
```
