node-hackgenius

1.0.0 • Public • Published

Hack Genius

A very simple API for searching and retrieving content from Genius.com. No support for annotations yet. Whats the point? Peer reviewed lyrics.

Returns Bluebird promises.

API

search(req: string): Promise<GeniusSearchResult[]>

genius.search('adoration of the magi')
  .then(console.log)

// =>

[ { artist: 'Lupe Fiasco (Ft. Crystal Torres)',
    title: 'Adoration Of The Magi',
    url: 'http://genius.com/Lupe-fiasco-adoration-of-the-magi-lyrics',
    id: 663358 },
  { artist: 'Rap Genius',
    title: 'Top 10 Lines from Tetsuo & Youth',
    url: 'http://genius.com/Rap-genius-top-10-lines-from-tetsuo-and-youth-lyrics',
    id: 690434 },
  { artist: 'Lupe Fiasco',
    title: 'Tetsuo & Youth Tracklist and Album Cover',
    url: 'http://genius.com/Lupe-fiasco-tetsuo-and-youth-tracklist-and-album-cover-annotated',
    id: 601621 }, ... ]

getContent(req: string|GeniusSearchResult): Promise<string>

genius.getContent('adoration of the magi') // gets first result
  .then(console.log) // =>

... lupe ...

genius.search('sing about me')
  .then(function(results) {
    return genius.getContent(results[0]);
  })
  .then(function(result) {
    console.log(result) // ... kendrick ...
  })

Readme

Keywords

none

Package Sidebar

Install

npm i node-hackgenius

Weekly Downloads

2

Version

1.0.0

License

WTFPL

Last publish

Collaborators

  • jonjaques