Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rbot_remote = '~/bin/rbot-remote'
- rbot_user = 'owner'
- rbot_password = 'PASSWORD'
- channel = '#CHANNEL'
- event = ARGV.first
- if event == 'songstart'
- d = {}
- STDIN.each_line { |line| d.store(*line.chomp.split('=', 2)) }
- if (d['rating'] == '1') do
- if (d['loved'].to_i >3) do
- d['loved'] = 3
- end
- end
- IO.popen("#{rbot_remote} -u #{rbot_user} -p #{rbot_password} -d '#{channel}'",
- 'w') do |p|
- p.write("Now playing: \"#{d['title']}\" by \"#{d['artist']}\" on \"#{d['album']}\" loved \"#{d['loved']}\")
- end
- end
Add Comment
Please, Sign In to add comment