Skip to content

blue-hope/give-me-profile

Repository files navigation

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