GitHub + Node.js + turntable.fm = Funbot!

You may also like...

9 Responses

  1. Lindsay says:

    Good stuff! Do you have an experience with the plug.dj API? I was looking into making a bot for that site since it works like TT, but it works internationally and I’m in Canada so can’t use TT. I also like the idea that plug.dj can reach a far wider audience when playing my mixes. ;) If you have used their API for anything I’d like to know how you think it compares.

  2. Greg Nilsen says:

    Lindsay,

    I haven’t tried out plug.dj yet, but their API looks pretty reasonable. I’d take a look at the code on GitHub for the Turntable API (https://github.com/alaingilbert/Turntable-API) as a starting point, and I think the plug.dj API interaction would be very similar.

  3. Conner C says:

    Hey, Greg!

    I am very new to any real computer work.. So my first “project” was a turntable.fm bot! I successfully made a “sparkle” bot… And he’s working great! My new idea is… (and I’ve seen it done before) how do I make my bot work as a DJ? I have logged into the bots account, and made a playlist that goes with my room, and I have tried signing in, running the bot with CMD, and then logging out… But when I log into my “real” account, and go into the room, he is djing, but he loses the ability to send the welcome PM’s, and the welcome message overall… Is there any way I can change this in the config? Or do I need to do something else..?

  4. Greg Nilsen says:

    Conner,

    It sounds like there may be something wrong with your script and it is dying when you enter the room. Try logging as much info into the console as you can to debug, from each action to the data that is being used. That should help you to pinpoint the problem.

  5. Michelle says:

    Hey Greg!
    Hey Alain-

    I found you via github (and your bot) & I was wondering if you could help me with a problem I’ve been running into w/getting my bot running. I’ve got everything else completed and I go to ‘node bot.js’ and I get this message:

    Darth-Vader:mom michellekehl$ node bot.js
    mom >>> Missing custom EnableQueue, loading default.
    mom >>> Initializing
    mom >>> Done
    mom >>> Hooking events
    mom >>> Done
    mom >>> Ready
    mom >>> Bot Ready
    mom >>> Room Changed
    mom >>> Registering Users

    /Users/michellekehl/Desktop/mom/functions.js:43
    activeDj = data.room.metadata.current_dj;
    ^
    TypeError: Cannot read property ‘metadata’ of undefined
    at global.OnRoomChanged (/Users/michellekehl/Desktop/mom/functions.js:43:22)
    at EventEmitter.emit (events.js:96:17)
    at Bot.onMessage (/Users/michellekehl/Desktop/mom/node_modules/ttapi/bot.js:196:18)
    at frameType (/Users/michellekehl/Desktop/mom/node_modules/ttapi/websocket.js:308:30)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)
    Darth-Vader:mom michellekehl$
    ———————
    Is there an easy solution that I’m missing? Any help you could give would be awesome! Thanks!

    -Michelle

  6. Michelle says:

    ^not sure where they ‘Hey Greg’ part popped in, that was leftover from an old email! Sorry about that!

  7. Greg Nilsen says:

    Well, you were right with Greg, Michelle. Not sure where Alain comes from…

    Unfortunately, I haven’t fired up my code for a while, as I’ve grown to use TT less, so I’m just going off of what you’ve posted.

    Anyway, unless the API has changed recently, that syntax looks correct. For cases like this, I’d recommend trying to output the contents of “data.room.metadata” to the console to see the contents of that:

    Log(data.room.metadata);

    If I remember correctly, node.js should write the data structure out to the console without issue.

    Hopefully that will shed some light on your problem.

  8. Austin Ludlow says:

    how do you install files from cmd?

  9. Greg Nilsen says:

    Here you go Austin:

    Command-Line Options

Leave a Reply