Giter Site home page Giter Site logo

lyrics's Introduction

lyrics

Search song lyrics or, the other way around, search songs from lyrics.

Install

(ql:quickload :lyrics)

Usage

Search the lyrics given an artist and a song name

(lyrics "lake of tears" "the homecoming")
=> "It's the way of a cosmic sailor, in a boat in the night
    But the wolves are not scaring him, he's alright
    Just the day, just the day away, I can feel it sometimes
    ..."

Or, search in the local database for all the songs that contain a given string. The result is a list of artist name, song-name and the verse line that contains the input string.

(search-song "the night")
=> (("coldplay" "Cemeteries of London" "save the night time for your weeping")
    ("coldplay" "Cemeteries of London" "and the night over london lay")
    ("lake of tears" "Forever Autumn" "but the night becomes you")
    ("lake of tears" "The Homecoming" "And the night that showed them all to me?"))

API

lyrics artist song

Memoized lyrics search. Search the lyrics for the given artist and song
name. If the lyrics are not in the db, try and extract them from one of the
supported lyrics websites. If found, save the lyrics in the db and return them. If
not found, return nil.

request-lyrics list-of-artists-and-songs

Start an asynchronous request for lyrics. The argument is a list of
artist-name and song-name lists. This is a batch request for lyrics. The actual
lyrics can be later retrieved from the database since this function only returns
the thread that is started for the request.

search-song lyrics

Return a list of entries, where each entry is a list with the artist name,
the song name and the verse line where the lyrics appears. The artist name and
song can be used to request the full lyrics. There can be multiple entries for
the same artist/song combination.

Details

lyrics uses an sqlite3 database to save all the lyrics that have been searched and found so far. The database file, ~/cl-lyrics.db, is created when the library is first loaded and it is saved in the user home folder.

The following lyrics websites are currently supported and searched for lyrics:

  • makeitpersonal
  • genius
  • songlyrics
  • metrolyrics
  • musixmatch
  • azlyrics

If the song cannot be found on any of the websites, lyrics returns nil. Otherwise lyrics returns the song lyrics and saves them in the database from where they will be fetched on the next call. The lyrics function is memoized.

Authors

Copyright (c) 2019 Mihai Olteanu

Licensed under the GPLv3 license.

lyrics's People

Contributors

hyotang666 avatar mihaiolteanu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.