glyrics

package
v2.2.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package gLyrics is a library for extracting lyrics from lyrics websites. It also comes with a lyrics search function which uses google custom search to provide the most accurate results possible.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractLyrics

func ExtractLyrics(url string) (*models.Lyrics, error)

ExtractLyrics wraps the provided url in a Request and performs ExtractLyricsFromRequest.

func ExtractLyricsFromRequest

func ExtractLyricsFromRequest(request models.Request) (*models.Lyrics, error)

ExtractLyricsFromRequest tries to extract lyrics from the provided Request. It tries all extractors from extractors.Extractors and returns the first one that was successful. Errors from extracting lyrics are ignored. The only error returned by this function is when no extractor was able to extract any lyrics.

func GoogleSearch

func GoogleSearch(query string, apiKey string) (<-chan string, chan<- bool)

GoogleSearch performs a google custom search with a search engine strongly optimised for lyrics. It returns a channel which yields all urls of the search results in order and a channel which can be used to stop the search. If not stopped the search channel will yield 100 search results.

func SearchFirstLyrics

func SearchFirstLyrics(query string, apiKey string) models.Lyrics

SearchFirstLyrics uses SearchLyrics to search for lyrics and returns the first result.

func SearchLyrics

func SearchLyrics(query string, apiKey string) (<-chan models.Lyrics, chan<- bool)

SearchLyrics uses GoogleSearch to search for lyrics websites based on the given query and turns them into Lyrics. Like the GoogleSearch method it returns two channels.

func SearchNLyrics

func SearchNLyrics(query, apiKey string, amount int) []models.Lyrics

SearchNLyrics uses SearchLyrics to search for lyrics and returns at most the specified amount of Lyrics.

Types

This section is empty.

Directories

Path Synopsis
Package extractors contains the various lyrics extractors for gLyrics.
Package extractors contains the various lyrics extractors for gLyrics.
Package models contains the models for gLyrics.
Package models contains the models for gLyrics.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL