blue-hope / give-me-profile

Support regex for world-wide SNS's user identifier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

give-me-profile

Support regex for world-wide SNS's user identifier

hits npm license


Installation

$ 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

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

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

import { SNSUrlRenderer, SNSList } from "give-me-profile";

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

License

MIT License

About

Support regex for world-wide SNS's user identifier

License:MIT License


Languages

Language:TypeScript 100.0%