How to use get-urls - 7 common examples

To help you get started, we’ve selected a few get-urls examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hugodias / facebook-post-preview / src / lambda / open-graph-preview.js View on Github external
export function handler(event, context, callback) {
  const text = event.queryStringParameters.q;
  const urls = getUrl(text);

  // Return if there is no urls in text
  if (!urls.size) {
    return callback(null, {
      statusCode: 200,
      body: JSON.stringify({
        text: text,
        meta: null,
        error: ["Empty url in text"]
      })
    });
  }

  // Retrieve first URL in text - urls are already normalized
  const url = [...urls][0];
  const options = { url };
github StoDevX / AAO-React-Native / source / views / sis / student-work / clean-job.js View on Github external
export function getLinksFromJob(job: JobType) {
	// Clean up returns, newlines, tabs, and misc symbols...
	// ...and search for application links in the text
	return [
		...getUrls(job.description),
		...getUrls(job.comments),
		...getUrls(job.skills),
	]
}
github StoDevX / AAO-React-Native / source / views / sis / student-work / clean-job.js View on Github external
export function getLinksFromJob(job: JobType) {
	// Clean up returns, newlines, tabs, and misc symbols...
	// ...and search for application links in the text
	return [
		...getUrls(job.description),
		...getUrls(job.comments),
		...getUrls(job.skills),
	]
}
github StoDevX / AAO-React-Native / source / views / sis / student-work / clean-job.js View on Github external
export function getLinksFromJob(job: JobType) {
	// Clean up returns, newlines, tabs, and misc symbols...
	// ...and search for application links in the text
	return [
		...getUrls(job.description),
		...getUrls(job.comments),
		...getUrls(job.skills),
	]
}
github niklaskorz / nkchat / server / src / resolvers / MessageResolver.ts View on Github external
const getEmbeds = (text: string): Embed[] => {
  const embeds = [];
  for (const urlString of getUrls(text)) {
    const url = new URL(urlString);
    const parser = embedHosts.get(url.hostname);
    const embed = (parser && parser(url)) || imageEmbedParser(url);
    if (embed) {
      embeds.push(embed);
    }
  }
  return embeds;
};
github madhanganesh / taskpad / ui / src / tasks / TaskList.js View on Github external
return this.props.tasks.map((task, index) => {
      const dateStr = moment(task.due).format('Do MMM');
      const className =
        task.dirty && task.error === undefined
          ? 'flex task task-dirty'
          : 'flex task';

      let links = [];
      const linkset = getUrls(task.notes);
      linkset.forEach(link => {
        if (links.length > 2) return;
        const linkitem = (
          <span data-tip="{link}">
             this.onLinkClicked(link)}
            /&gt;
          </span>
        );
        links.push(linkitem);
      });

      let actionsForTaskUnderMouse = null;
      if (this.state.taskUnderMouse === task.id &amp;&amp; !task.dirty) {
        actionsForTaskUnderMouse = (

get-urls

Get all URLs in a string

MIT
Latest version published 8 months ago

Package Health Score

66 / 100
Full package analysis

Popular get-urls functions