An open API service indexing awesome lists of open source software.

https://github.com/blue-hope/give-me-profile

Support regex for world-wide SNS's user identifier
https://github.com/blue-hope/give-me-profile

facebook github gitlab instagram linkedin medium regex regex-pattern sns stackoverflow youtube

Last synced: about 1 month ago
JSON representation

Support regex for world-wide SNS's user identifier

Awesome Lists containing this project

README

        


give-me-profile



Support regex for world-wide SNS's user identifier



hits
npm
license




## Installation
```shell
$ npm i give-me-profile --save
```

## Before Usage
> 🌐 **Getting Help** — give-me-profile is not yet tested whole accounts of world-wide SNS
> (and it's quite difficult!) so feel
> free to opening issues or PR

## How to get user identifier for SNS?
* **Facebook**
> For your account, Open https://facebook.com/me on your browser

`SNSList.FACEBOOK_USERNAME`: https://www.facebook.com/[id]

`SNSList.FACEBOOK_PROFILE`: https://www.facebook.com/profile.php?id=[id]

* **Instagram**

`SNSList.INSTAGRAM`: https://www.instagram.com/[id]/

* **LinkedIn**

`SNSList.LINKEDIN`: https://www.linkedin.com/in/[id]/

* **Stackoverflow**

`SNSList.STACKOVERFLOW`: https://stackoverflow.com/users/[id]

* **Github**

`SNSList.GITHUB`: https://github.com/[id]

* **Gitlab**

`SNSList.GITLAB`: https://gitlab.com/[id]

* **Medium**

`SNSList.MEDIUM_PREFIX`: https://[id].medium.com

`SNSList.MEDIUM_SUFFIX`: https://medium.com/[id]

* **Youtube**

`SNSList.YOUTUBE_USER`: https://www.youtube.com/user/[id]

`SNSList.YOUTUBE_CHANNEL`: https://www.youtube.com/channel/[id]
## Usage
### We support regex for world-wide SNS's user identifier
```js
import { SNSRegex, SNSList } from "give-me-profile";

SNSRegex(SNSList.GITHUB) // /^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$/i;
```

### We provide regex test
```js
import { SNSTester, SNSList } from "give-me-profile";

SNSTester(SNSList.GITHUB, "blue-hope") // true
SNSTester(SNSList.GITHUB, "****") // false
```

### We provide whole user profile url for the id above
```js
import { SNSUrlRenderer, SNSList } from "give-me-profile";

SNSUrlRenderer(SNSList.GITHUB, "blue-hope") // https://github.com/blue-hope
```

## License
MIT License