/lyrics-scraper

A simple yet powerful genius lyrics scrapper for Node.js

Primary LanguageJavaScriptEclipse Public License 2.0EPL-2.0

lyrics-scraper-example

The simplest yet most powerful Genius Lyrics scrapper


CodeFactor


💠 Description:

  • This is a Scraper which can scrap and give you lyrics of any song that's available on Genius Offitial Site.
  • This can return both album thumbnail and lyrics if they are available through thw power of web scraping.
  • Scraping an website is not always allowed by the website owners. This project is made for educational purposes only.

💫 Installation:

npm i @fantox01/lyrics-scraper

🧩 Usage:

  • Make sure to always use an asynchronous function to fetch

Metod 1:

const {getThumbnail, getLyrics} = require('@fantox01/lyrics-scraper');

async function main() {
    const query = "Heat Waves";
    const thumbnailUrl = await getThumbnail(query);
    const lyrics = await getLyrics(query);

    console.log(thumbnailUrl+"\n\n");
    console.log(lyrics); 
  }
  
  main();
  

Method 2:

const {getThumbnail, getLyrics} = require('@fantox01/lyrics-scraper');

const query = "Heat Waves";

getThumbnail(query).then((thumbnailUrl) => {
    console.log(thumbnailUrl);
});

getLyrics(query).then((lyrics) => {
    console.log(lyrics);
});