rahuldkjain / github-profile-readme-generator

🚀 Generate GitHub profile README easily with the latest add-ons like visitors count, GitHub stats, etc using minimal UI.
https://rahuldkjain.github.io/gh-profile-readme-generator
Apache License 2.0
21.12k stars 6.57k forks source link

Extract username from social links #18

Open antonkomarev opened 4 years ago

antonkomarev commented 4 years ago

A lot of people pasting links to their social links accounts instead of writing only username. It leads to generating counter with link: /ghpvc/?username=https://github.com/example-username Instead of: /ghpvc/?username=example-username

The better way will cutting domain part of the social website and leave only username automatically.

After then validation could be performed. For GitHub username you could use shinnn GitHub username validator

rahuldkjain commented 4 years ago

@antonkomarev working on it!

rahuldkjain commented 4 years ago

@antonkomarev issue is fixed by #22 . Kindly check

antonkomarev commented 4 years ago

Validation works good. The next thing I could propose for the future - you could make check on input unfocus if value starting from https://github.com/*. If so - make a preg_match, extract username and replace input value with username only. After then perform validation.