Skip to content

Instantly share code, notes, and snippets.

@shibafu528
Last active August 29, 2015 14:10
Show Gist options
  • Save shibafu528/c3780f2b9cb67574df3a to your computer and use it in GitHub Desktop.
Save shibafu528/c3780f2b9cb67574df3a to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
# Dependencies
# - mikutter_gstreamer
require 'soundcloud'
CLIENT_ID = 'ac11c1fa19b6bc56a48edde5e40cbc18'
Plugin.create :play_teokure_toshi_a do
command(:play_teokure_toshi_a,
name: 'ておくれとしぁさんの曲',
condition: lambda{ |opt| true},
visible: false,
role: :window) do |opt|
activity :system, "いい曲見つけてきたよっ!\n\n(Sound by mu9ree_2 https://soundcloud.com/mu9ree-1/m7t5usqacrd4)"
SerialThread.new do
client = Soundcloud.new(:client_id => CLIENT_ID)
track = client.get('/resolve', :url => "https://soundcloud.com/mu9ree-1/m7t5usqacrd4")
Plugin.call(:gst_play, "#{track.stream_url}?client_id=#{CLIENT_ID}", :mikutter_drumnbass)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment