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 ¶
- func ExtractLyrics(url string) (*models.Lyrics, error)
- func ExtractLyricsFromRequest(request models.Request) (*models.Lyrics, error)
- func GoogleSearch(query string, apiKey string) (<-chan string, chan<- bool)
- func SearchFirstLyrics(query string, apiKey string) models.Lyrics
- func SearchLyrics(query string, apiKey string) (<-chan models.Lyrics, chan<- bool)
- func SearchNLyrics(query, apiKey string, amount int) []models.Lyrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractLyrics ¶
ExtractLyrics wraps the provided url in a Request and performs ExtractLyricsFromRequest.
func ExtractLyricsFromRequest ¶
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 ¶
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 ¶
SearchFirstLyrics uses SearchLyrics to search for lyrics and returns the first result.
func SearchLyrics ¶
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.
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. |