Skip to content

Serverless function: Link Clip ๐Ÿ’ป๐Ÿ“๐Ÿ“Œ

Notifications You must be signed in to change notification settings

willknight27/link-clip-serverless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Link Clip - Serverless functions

Serverless Project for URL Data Extraction

This project is developed in Node.js using TypeScript and follows a serverless architecture. It's responsible for extracting relevant data from a given URL, such as the title, description, main image, and domain.

Installation

To install and run this project locally, follow these steps:

  1. Clone this repository to your local machine.
  2. Ensure you have Node.js and npm installed.
  3. Install dependencies

Using the Function

You can utilize the function to extract data from a provided URL by sending a GET request to the function URL with the url parameter containing the URL you wish to process. Below is an example of how to do this:

Expected Response

The function will respond with a JSON object containing the extracted information from the provided URL:

{
  "title": "synthwave radio ๐ŸŒŒ - beats to chill/game to - YouTube",
  "description": "๐ŸŽผ | Listen on Spotify, Apple music and moreโ†’  https://fanlink.tv/ChillSynthwave๐ŸŽถ | Subscribe to this channel for more synthwave musicโ†’  https://bit.ly/synt...",
  "source": "https://www.youtube.com/watch?v=4xDzrJKXOOY",
  "img": "https://i.ytimg.com/vi/4xDzrJKXOOY/maxresdefault_live.jpg",
  "domain": "https://www.youtube.com"
}

Dependencies

  • @netlify/functions
npm install @netlify/functions

axios

npm installl axios

cheerio

npm install cheerio

Dev dependencies

  • typescript
  • @types/node
  • rimraf
  • ts-node-dev
  • commit-and-tag-version
npm install -D typescript @types/node ts-node-dev rimraf commit-and-tag-version
  • netlify/cli
npm install -D netlify-cli 
  • @types/cheerio
npm install --save-dev @types/cheerio

TypeScript config (tsconfig.json)

npm run tsc:init

About

Serverless function: Link Clip ๐Ÿ’ป๐Ÿ“๐Ÿ“Œ

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published