Skip to content
Node.JS binding to interact with toma.hk
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
.gitignore
LICENSE
README.md
package.json

README.md

node-tomahk

Bindings for node.js to interact and using the toma.hk website. Install it using:

$ npm install tomahk

Create a playlist

tomahk.createPlaylist("Awesome playlist!", [
    {artist: "Bloc Party", title: "Ratchet"},
    {artist: "Vampire Weekend", title: "A-Punk"}
  ], function (url) {
    console.log("Playlist URL: " + url);
  });

Get the URL for an album

var url = tomahk.albumUrl('Blur', '13');

Get the URL for a track

var url = tomahk.trackUrl('Bloc Party', 'Ratchet');
// toma.hk redirects this to a shortened url which you can get via
tomahk.shortTrackUrl('Bloc Party', 'Ratchet', function (url) {
  console.log('Listen to Bloc Party - Ratchet at ' + url);
});

Get the URL for an artist

var url = tomahk.artistUrl('Bloc Party');
Something went wrong with that request. Please try again.