1.1.7 • Published 3 years ago

lautfm v1.1.7

Weekly downloads
8
License
MIT
Repository
github
Last release
3 years ago

lautfm

Nodejs module for Webservice laut.fm API

Details about the API

Install

npm install lautfm

Usage

const Lautfm = require('lautfm')

const laut = new Lautfm();

laut.searchStations({query: 'ska', limit: 2})
    .then(data => console.log(data))
    .catch(err => console.error(err))

Methods

  • getGenres() All available genres.
  • getStation(<name>[, section]) Get Station details.
  • getStations([filter]) Get a list of stations
  • getServerTime() The server time
  • getServerStatus() The current server status and a message.
  • getGenres([list]) All available genres
  • getLetters() All available starting-letters of the stations.
  • getStationNames() The names of all stations.
  • getListeners() The listeners of all stations.
  • searchStations(<params>[, list]) Search stations http://api.laut.fm/documentation/search

Properties

  • station_sections List of available sections for getStation()
  • stations_by List of available types for getStations({by: {type}...})

section

Values used as section parameters in getStation(<name>[, section]).

sectionDescription
current_songThe currently playing song of a single station.
last_songsThe 10 last songs of a single station.
listenersThe listener count of a single station.
next_artistsNext artists of a single station. Information may be inacurate or plainly wrong right before a playlist or schedule change.
playlistsThe schedule of a single station grouped by playlists.
scheduleThe schedule of a single station.

Station by types

Values used as 'by' in filter object used in getStations()

typeDescription
genreAll stations of a certain genre.
letterAll stations beginning with the certain letter.
liveA list of all stations sending live at the moment.
numbersAll stations beginning with a number.

Example

Get all stations starting with letter e

let filter = {
  by: 'letter', // filter by letter
  term: 'e'     // stationname starting with 'e'
}
laut.getStations(filter)
  .then(data => console.log(data))
  .catch(err => console.error(err))

Result will be a Object like this

1.1.7

3 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago