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
- Host: GitHub
- URL: https://github.com/blue-hope/give-me-profile
- Owner: blue-hope
- License: mit
- Created: 2021-05-19T18:44:17.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-21T07:48:52.000Z (almost 4 years ago)
- Last Synced: 2025-03-23T21:51:54.616Z (about 2 months ago)
- Topics: facebook, github, gitlab, instagram, linkedin, medium, regex, regex-pattern, sns, stackoverflow, youtube
- Language: TypeScript
- Homepage:
- Size: 20.5 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
## 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