Salesflare / social-profile-url-parser

Node library to parse social profile urls out of text.
MIT License
3 stars 1 forks source link

adding new services #20

Open janzheng opened 4 years ago

janzheng commented 4 years ago

Awesome piece of code! I've added a few academic profile services (ORCID, ResearchGate, Google Scholar, Publons, and ProtocolsIO), and was wondering if you'd like me to do a pull request, or if you just wanted me to add the regexes in here since they're so simple... not sure if it's worth the #effort to do a pull request.

here they are:

orcid: /https?:\/\/(www\.)?orcid\.org\/([^ /\n]+)/ig,
researchgate: /https?:\/\/(www\.)?researchgate\.net\/profile\/([^ /\n]+)/ig,
googlescholar: /https?:\/\/scholar\.google\.com\/citations\?user=([^ /\n]+)/ig,
publons: /https?:\/\/(www\.)?publons\.com\/researcher\/([0-9]{0,9})?\/([^ /\n]+)/ig,
protocolsio: /https?:\/\/(www\.)?protocols\.io\/researchers\/([^ /\n]+)/ig,

and for the typeNameMap:

['orcid', 'ORCID'],
['researchgate', 'ResearchGate'],
['googlescholar', 'GoogleScholar'],
['publons', 'Publons'],
['protocolsio', 'ProtocolsIO'],

cheers

AdriVanHoudt commented 4 years ago

Hi @janzheng PRs are definitely welcome! Make sure to also update the test.