function extractDomain(url) {
  try {
    const parsedUrl = new URL(url)
    return parsedUrl.hostname
  } catch (error) {
    // If URL parsing fails, use a placeholder
    return 'unknown-source'
  }
}
Extracts the domain from a URL.
@param {string} url - The URL to parse.
@returns {string} - The extracted domain.