Hubot XBMC Script - Help Needed

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
~Chi Offline
Junior Member
Posts: 1
Joined: May 2011
Reputation: 0
Post: #1
First off I would like to apologize if this post sounds like I'm trying to get someone to do the hard work for me, its nothing like that but the amount of documentation on hubot, and hubot scripts is very limited and looking at previously written hubot scripts has only gotten me so far. I'm new to CoffeeScript, and haven't done much coding outside of HTML, CSS & a small amount of JavaScript (mostly within the jQuery realm). I'm trying to write a script for hubot that will allow me control XBMC (mostly just for music) What I've gathered so far is that I first off need to define the name of XBMC running, as well as the IP Address of the XBMC.

Code:
# Description
#   Control XBMC Music from Hubot
#
# Dependencies:
#   None
#
# Configuration:
#   HUBOT_XBMC_NAME
#    HUBOT_XBMC_URL
#
# Commands:
#   hubot play - starts playing music
#    hubot play next - plays the next song
#   hubot what's playing - Returns the title of the current song
#    hubot play <artist> - Querys for artist and plays it
#    hubot play <album> - Querys for album and plays it
#    hubot play <song> - Querys for song and plays it
#    hubot where's server - Returns the IP/Web Address of the current XBMC location
#    hubot volume? - Returns current volume
#    hubot volume [0-100] - Sets the volume
#    hubot shutup - Mutes the music.
#
# Notes:
#   None
#
# Author:
#   eriley


xbmc =
    name = "#{process.env.HUBOT_XBMC_NAME}"
    url  = "#{process.env.HUBOT_XBMC_URL}"

module.exports = (robot) ->
    robot.respond /play (.*)/i, (message) ->

    robot.respond /play next/i, (message) ->

    robot.respond /what'?s playing/i, (message) ->
    
    robot.respond /volume ([+-])?(.*)/i, (message) ->


After this though, my lack of knowledge in CoffeeScript/JavaScript and JSON API along with the lack of already written scripts that are passing params through JSON leave me lost. Can anybody help me with this?

Again, not looking for someone to write it for me, but some help would be greatly appreciated, this is definitely something I want to learn.

I'm also not sure if this is the write forum, I apologize for that.
(This post was last modified: 2013-12-21 05:53 by ~Chi.)
find quote