1
0
Fork 0
vkontakte_music_search/README.md

805 B

Vkontakte (VK.com) API music search tool

Don't forget to log in to vk.com API

CoffeeScript example

vk_music = new VkontakteMusic
vk_music.search "Kasabian", "L.S.F. (Lost Souls Forever)", "2:17", (url) ->
  audio = document.createElement "audio"
  audio.setAttribute "src", url
  document.getElementsByTagName("body")[0].appendChild audio
  audio.play()
  false

JavaScript example

var vk_music;
vk_music = new VkontakteMusic;
vk_music.search("Kasabian", "L.S.F. (Lost Souls Forever)", "2:17", function(url) {
  var audio;
  audio = document.createElement("audio");
  audio.setAttribute("src", url);
  document.getElementsByTagName("body")[0].appendChild(audio);
  audio.play();
  return false;
});