1.0.0 • Published 1 year ago

semantic-link-parser v1.0.0

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
1 year ago

semantic-link-parser 🗂️

Extracts content information from known URL patterns.

import {
  extractContentInfoFromUrl,
} from 'semantic-link-parser';

extractContentInfoFromUrl('https://youtu.be/8Qn_spdM5Zg?t=5');

// {
//   content: 'VIDEO',
//   id: '8Qn_spdM5Zg',
//   site: 'YOUTUBE',
//   url: 'https://www.youtube.com/watch?v=8Qn_spdM5Zg'
// }

extractContentInfoFromUrl('https://soundcloud.com/strangehumman/kyoto-2?utm_source=clipboard&utm_medium=text&utm_campaign=social_sharing');

// {
//   content: 'TRACK',
//   id: 'kyoto-2',
//   username: 'strangehumman',
//   url: 'https://soundcloud.com/strangehumman/kyoto-2',
// }

Supported Sites

Adding New Sites

  1. Update SiteContentInfo
  2. Update siteContentRules
  3. Update "Supported Sites" documentation
1.0.0

1 year ago