npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fantox01/lyrics-scraper

v3.0.1

Published

A simple yet most powerful scraper to get lyrics and thumbnail of any song from Genius Lyrics

Downloads

274

Readme

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.

Whats New on version 3.0.1

  • Added ES6 Javascript and Typescript Support
  • Updated code according to updated Genius Lyrics page HTML
  • Added JS Doc for more clear implementation
  • Added support for promises too
  • Removed backwards compatibility for older version of this package (Use npm i @fantox01/lyrics-scraper@latest to update)

Installation:

npm i @fantox01/lyrics-scraper
yarn add @fantox01/lyrics-scraper

Usage:

  • For ES5 Javascript
const getLyrics = require("@fantox01/lyrics-scraper");

const main = async () => {
  const data = await getLyrics("Heat Waves");
  console.log(data);
};
main();
  • For ES6 Javascript / Typescript
import { getLyrics } from "@fantox01/lyrics-scraper";

const main = async () => {
  const data = await getLyrics("Heat Waves");
  console.log(data);
};
main();

Output:

  • It will automatically format the lyrics and add new lines ("\n").
  • Use console.log(data.lyrics) to for only lyrics and console.log(data.thumbnail) to get only thumbnail.
{
  status: 200,
  url: 'https://genius.com/Glass-animals-heat-waves-lyrics',
  album: 'Heat Waves by Glass Animals',
  artist: 'Glass Animals',
  release_date: 'June 29, 2020',
  thumbnail: 'https://images.genius.com/25ffad8f4a6804e3efc869253f030baf.1000x1000x1.jpg',
  lyrics: '[Intro]\n' +
    '(Last night, all I think about is you)\n' +
    "(Don't stop, baby, you can walk through)\n" +
    "(Don't want, baby, think about you)\n" +
    "(You know that I'm never gonna lose)\n" +
    "Road shimmer wigglin' the vision\n" +
    "Heat, heat waves, I'm swimmin' in a mirror\n" +
    "Road shimmer wigglin' the vision\n" +
    "Heat, heat waves, I'm swimmin' in a—\n" +
    '\n' +
    '[Chorus]\n' +
    'Sometimes, all I think about is you\n' +
    'Late nights in the middle of June\n' +
    "Heat waves been fakin' me out\n" +
    "Can't make you happier now\n" +
    'Sometimes, all I think about is you\n' +
    'Late nights in the middle of June\n' +
    "Heat waves been fakin' me out\n" +
    "Can't make you happier now\n" +
    '\n' +
    '[Verse 1]\n' +
    "Usually, I put somethin' on TV\n" +
    'So we never think about you and me\n' +
    'But today, I see our reflections clearly\n' +
    "In Hollywood, layin' on the screen\n" +
    'You just need a better life than this\n' +
    "You need somethin' I can never give\n" +
    'Fake water all across the road\n' +
    "It's gone now, the night has come, but\n" +
    '\n' +
    '[Chorus]\n' +
    'Sometimes, all I think about is you\n' +
    'Late nights in the middle of June\n' +
    "Heat waves been fakin' me out\n" +
    "Can't make you happier now\n" +
    '\n' +
    '[Verse 2]\n' +
    "You can't fight it, you can't breathe\n" +
    "You say somethin' so lovin', but\n" +
    'Now I gotta let you go\n' +
    "You'll be better off in someone new\n" +
    "I don't wanna be alone\n" +
    'You know it hurts me too\n' +
    'You look so broken when you cry\n' +
    'One more and then I say goodbye\n' +
    '\n' +
    '[Chorus]\n' +
    'Sometimes, all I think about is you\n' +
    'Late nights in the middle of June\n' +
    "Heat waves been fakin' me out\n" +
    "Can't make you happier now\n" +
    'Sometimes, all I think about is you\n' +
    'Late nights in the middle of June\n' +
    "Heat waves been fakin' me out\n" +
    "Can't make you happier now\n" +
    '\n' +
    '[Bridge]\n' +
    "I just wonder what you're dreamin' of\n" +
    'When you sleep and smile so comfortable\n' +
    'I just wish that I could give you that\n' +
    "That look that's perfectly un-sad\n" +
    'Sometimes, all I think about is you\n' +
    'Late nights in the middle of June\n' +
    "Heat waves been fakin' me out\n" +
    "Heat waves been fakin' me out\n" +
    '\n' +
    '[Chorus]\n' +
    'Sometimes, all I think about is you\n' +
    'Late nights in the middle of June\n' +
    "Heat waves been fakin' me out\n" +
    "Can't make you happier now\n" +
    'Sometimes, all I think about is you\n' +
    'Late nights in the middle of June\n' +
    "Heat waves been fakin' me out\n" +
    "Can't make you happier now\n" +
    '\n' +
    '[Outro]\n' +
    "Road shimmer wigglin' the vision\n" +
    "Heat, heat waves, I'm swimmin' in a mirror\n" +
    "Road shimmer wigglin' the vision\n" +
    "Heat, heat waves, I'm swimmin' in a mirror"
}

Making of @fantox01/lyrics-scraper

How?

  • Using Axios and Cheerio
  • Axios - A promise based HTTP client for the browser and node.js
  • Cheerio - A fast, flexible, and elegant library for parsing and manipulating HTML and XML.

Why?

  • IDK, scraping is fun to me and also legal upto a limited extend as long as you don't misuse it.

Contributions

  • Made by FantoX
  • I don't have any other contributors in this project yet. Feel free to contribute.

Support me

  • Give this project a 🌟 if you like my project.
  • Please follow me on GitHub to get notified about my upcoming projects.